Multithreading + Networking (desperate)
i'm trying to implement a simple p2p server.
the server should listen on a port for incoming connection and when there is it launches a new thread which will accept the connection and open a TCP port with this client.
before anything the client should send his username and version of prog he is using.
1- how can i implement threading that will allow to many users to connect to this server at the same time. (how will i differentiate between them if they use the same socket).
2- if the user send his username ... i store this in a string on the server and check for it, then he sends his password how will i check, will i override the prev string ( how will i know that the name ended and the password started)
Please helppp !!!!!!