1 port, listening and connecting, how to

This is a discussion on 1 port, listening and connecting, how to within the Linux Networking forums, part of the Linux Forums category; Hi, I am implementing a client using TCP/IP and Berkeley sockets. I would like to have one port to ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-10-2004
Marcia Hon
 
Posts: n/a
Default 1 port, listening and connecting, how to

Hi,

I am implementing a client using TCP/IP and Berkeley sockets. I would like
to have one port to connect to the server AND listen to incoming
connections. I don't know how to do this.

Would I have to use threads, forks? Is there a way to do this without
threads, forks?

Thank you so much for your help.

Marcia Hon


Reply With Quote
  #2 (permalink)  
Old 02-10-2004
Cameron Kerr
 
Posts: n/a
Default Re: 1 port, listening and connecting, how to

Marcia Hon <honm@rogers.com> wrote:
> Hi,
>
> I am implementing a client using TCP/IP and Berkeley sockets. I would like
> to have one port to connect to the server AND listen to incoming
> connections. I don't know how to do this.


Using select(2). fork(2) would also be a solution, depending on what you
wanted to do.

Search for 'beej' on Google and hit the first link.

And then go out and by 'UNIX Network Programming', by Stevens.

--
Cameron Kerr
cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/
Empowered by Perl!
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:41 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0