Socket issue
-
Hi, I created an socket program where a server listen and number of clients connect to it. Clients have a common static ip and individual local ip of their own system. In client side if i give Socket.LocalEndPoint i get the local IP address of the client, same i check in the serverside, ie Socket.RemoteEndPoint i get the static IP of the clients network. so all the client IP shown in the server as same. How can i identify each clients? Will there be same port in diffrent system in a network of a single static IP? Thanks, Yesuprakash
-
Hi, I created an socket program where a server listen and number of clients connect to it. Clients have a common static ip and individual local ip of their own system. In client side if i give Socket.LocalEndPoint i get the local IP address of the client, same i check in the serverside, ie Socket.RemoteEndPoint i get the static IP of the clients network. so all the client IP shown in the server as same. How can i identify each clients? Will there be same port in diffrent system in a network of a single static IP? Thanks, Yesuprakash
I'm not so sure you can distinguish that info with the socket alone. I've always spun up a new thread or created new objects to deal with the new socket connection, so I knew that they were different. If you need some kind of identification, you'll need to transmit that information from the client to server on a connection, or request it from the server. Bottom line I think is that you'll need to program it into the client. Hope that helped... Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin -
I'm not so sure you can distinguish that info with the socket alone. I've always spun up a new thread or created new objects to deal with the new socket connection, so I knew that they were different. If you need some kind of identification, you'll need to transmit that information from the client to server on a connection, or request it from the server. Bottom line I think is that you'll need to program it into the client. Hope that helped... Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin