Networking Basic question regarding accepting connection

Tag: networking Author: hnnet Date: 2011-08-27

I have a very basic question regarding accepting connections to a network server from multiple clients.

  1. A Server listens on port 80
  2. A client connects on port 80
  3. Server still listens for connections on port 80
  4. Another client connects on port 80
  5. Server accepts the connection.

Now from here on is it the duty of the programmer to find out the requested ip and keep requests as separate and handle?

PS: This is in winsock impln

Thanks,

Other Answer1

is it the duty of the programmer to find out the requested ip

No.

and keep requests as separate and handle?

All the programmer needs to do is keep hold of the accepted socket identifier and typically run a thread to handle all its I/O. If the application needs the remote address of the peer it can get it any time via getsockname() or whatever your language RTL provides on top of it.