Reputation: 1753
Imagine you have a server which can handle only one client at a time. The server uses WSAAsyncSelect to be notified of new connections. In this case, what is the best way of handling FD_ACCEPT messages:
A > Accept the connection attempt right away but queue the client until its turn?
B > Do not accept the next connection attempt until we are done serving the currently connected client?
What do you guys think is the most efficient?
Upvotes: 1
Views: 2764
Reputation: 32260
Here I describe the cons that I'm aware for both options. Hopefully this might help you decide.
A)
B)
Upvotes: 1
Reputation: 100133
Ask yourself: what do you want the user experience to be at the other end? Do you want them to be stuck? Do you want them to time out? Do you want them to get a polite message?
Upvotes: 1