|
-
April 22nd, 2010, 03:53 PM
#8
Re: Multithreading with sockets
 Originally Posted by awri
...The way I have chosen to implement this is to have the client side program first query the server via a hardcoded port # for an open port for which to connect to the server. Then with the fresh port # in hand the client closes that socket, freeing it up for another client to query the server, and opens up a new socket with the dedicated port.
As mentioned by Night_Wulfe, this is not the way sockets are designed to work. A server can accept many incoming connections on the exact same port. There is no need to negotiate a separate port number for each client.
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|