What is the second parameter's use in layman terms?
I set it to 0 and still can connect with multiple clients?
I thought it was for the number of clients.
(windows, tcp, multiclient server)
What is the second parameter's use in layman terms?
I set it to 0 and still can connect with multiple clients?
I thought it was for the number of clients.
(windows, tcp, multiclient server)
Using Windows 10 with Code Blocks and MingW.
have you read the manual?
When you set this parameter to 0The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that a later reattempt at connection succeeds.
if your second connection request arrives when the first is still being processed - you could get the error.
How much is the chance of this to occur - when you a manually generating connect request - very low IMHO.
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Yes, I read it but didnt understand.
So it is only for the time being it is processed.
Indeed it is processed very fast so on a manual connection its no big deal.
Thanks Vart.
Using Windows 10 with Code Blocks and MingW.
For sockets on Windows the Winsock FAQ here is a good resource.
You'll find a good answer to this question and others.
There's also an option to download the whole thing to your local disk for easy reference.