Hi all.
Im having a problem with my project.
I need that my socket recive multiple conections from differents pcs.
I have my socket, it is listening, when a pc connect to its, it stop listen, so there come the second computer trying to connect, and this computer cant doit beacuse socket isnt listening anymore.
I tried, putting the socket to listen, when anybody connects to it, the code makes another socket and it puts it in listen mode. The problem is that when i run the program there is an error and it shows that i cant have 2 sockets on the same port.

7 Years
Discussion Span
Last Post by krosty4782

The basic idea is this:

Each port can only have 1 passive listening socket, but many active sockets.

You code must listen for connections on the port, when one is detected, it must create a new socket to handle the active connection and then go back to passively listening for another connection.

Google will give a lot of code examples of this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.