• Advertisement
Sign in to follow this  

Fight against WSAWOULDBLOCK

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a multithread server which using TCP to broadcast knocking message to all client by 33 times a second (Each knocking message has about 1024bytes in size). After about 10 or above clients had been connected to my server (I'm using one machine to start all clients), WSAWOULDBLOCK erro message will be received continuously from my server after each sendto function. Is TCP protocol is not good to be used in my situation ? or do I missing any important issue for do this kind of method ?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
What's the upload limit on your modem?

Share this post


Link to post
Share on other sites
You're sending 33KB/s to each client?

Slightly related to your problem (you must ALWAYS use queues when dealing with nonblocking sockets), but isn't that A BIT MUCH?

Share this post


Link to post
Share on other sites
Sending 33Kb/s to each client is only a testing purpose. After there have around 10 clients connected to server, it got error message for WSAWOULDBLOCK after each sendto() statement. I'd try to detect those socket which can be written by using select(), even i got that socket is ready for being wrote, during the next sendto() statement I still got WSAWOULDBLOCK. I don't know what's the case and how to deal with this situation ?

Share this post


Link to post
Share on other sites
Try reducing the # of times per second to something more reasonable, like 2-5 (10 max). Also, 1KB every send is excessive. Try to reduce that, as well (delta compression, use smaller types (like BYTE instead of integer, or store 8 bools into a byte instead of using 8 bytes) ).

Share this post


Link to post
Share on other sites
Is TCP protocol may not be used for rapidly data transfer ? How to be done for commercial multi-player server ?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement