Is an opened socket exclusive to a client browser?

Hi!
I’m working on a project which will require an intranet server to communication via sockets (in XML) to software on another computer that will listen to incoming commands.

Since there will be about 50 clients (browsers) accessing that intranet server, I wanted to make sure that each socket request sent to the software by the intranet server from the individual clients will be exclusive and no crosstalk will be possible. So, if several clients send requests to the server at the same time, will the server be able to send the right answer to the right client, or is there a possibility that a client could receive the answer from another client’s request? I’m not very well versed in sockets so I just want to make sure. Crosstalk of the various XML answers would be catastrophic since they bring back prices for items called by ID by the clients (browsers)… Thanks!

That would work. Just be sure not to keep looping indefinitely until you get a connection - there might be something else going wrong. Try it a fixed number of times, then throw an exception/ error.

So I guess I’d have to construct something to wait for a socket to be released before sending a new socket command? (or with a “while error on socket create” loop) Since the 50 clients wouldn’t send that much requests, I guess they wouldn’t have much collisions I hope (gigabit intranet with very small/light requests).

I think that once you create the connection, you cannot create a new connection to the same socket. So while the socket is in use, you can be pretty sure that there’ll be no crosstalk. Any users who attempt to create the connection while it’s already open will probably get an error.

Try creating two connections to the same port in one script, the first one will connect and the second should fail.