CAsyncSocket server questions
-
Hi all i have been experimenting with CAsyncSocket and have derived my own class. I am able to connect a client to a server app that I have written (VC6) and all is working well. My first question is why does the server have to accept on another socket? My second question is if the server is to be designed to accept 64 clients connecting to it, does that mean I need to define 128 sockets Thanks for having a look at this! Regards Mike
-
Hi all i have been experimenting with CAsyncSocket and have derived my own class. I am able to connect a client to a server app that I have written (VC6) and all is working well. My first question is why does the server have to accept on another socket? My second question is if the server is to be designed to accept 64 clients connecting to it, does that mean I need to define 128 sockets Thanks for having a look at this! Regards Mike
MikeRWinter wrote:
My first question is why does the server have to accept on another socket?
TCP is a connection oriented protocol, the server needs to accept the connection and a handshake is performed before further communication will be possible (which is part of TCP's reliable data transfer). On the other hand, if you are working with UDP, which is not connection oriented, you don't have to call accept(), sockets can just send data when they feel like (which could also mean nobody is listening to them).
MikeRWinter wrote:
My second question is if the server is to be designed to accept 64 clients connecting to it,
Where does this limit come from, not sure what you mean? /Moak
Chat in Europe :java: Now with 24% more Twitter