"Marcia Hon" <com> wrote:
What do you mean by this? You want the outgoing connections to use the
same local port number as the incoming connections? Why do you think
this is necessary? Unless there's some special constraint, you should
normally let the OS choose an ephemeral port for outgoing connections,
and only use a well-known port for listening for incoming connections.
Threads and forking have nothing to do with the selection of ports. Now
I think you're asking something totally different, like how to manage
multiple sockets. You can have a separate thread or process manage each
connection if you want, or you can do it all in a single thread by using
select() or poll() to wait for something to happen on multiple sockets.
Barry Margolin, mit.edu
*** PLEASE post questions in newsgroups, not directly to me ***