posted 16 years ago
My questions involve singing in, and making sure a client is still logged on.
First, how should clients log onto the server? TCP or UDP?
TCP is connection oriented, so once I sign-in, the connection is always there, I can always check the status of the connection to know the status of the user.
Drawback is, it's costly maintaining a connection, specially as I get more users online.
UDP will require me to send ONE given packet to sign-in (assuming it arrives), but then, how do I update the server on my status status? Does the client send a message to the server every now and then to stay alive?
What if two users are chatting and one logs out? Should the client who logged out send a UDP packet to the server so that the server knows it logged out? Who should message the other client that was being chatted with?