I am writing an XMLRPC client in C ++ that is designed to communicate with an XMLRPC server in python.
Unfortunately, at the moment, python-based XMLRPC server is only able to issue one connection request, then it disconnects, I discovered this thanks to mhawke's answer to my previous request about a related subject
Because of this, I need to create a new socket connection to my python server every time I want to make an XMLRPC request. This means creating and removing multiple sockets. Everything is working fine until I approach ~ 4000 queries. At this point, I get socket error 10048, Socket in use .
I tried a sleep thread so that winsock corrected its file descriptors, a trick that worked when my python client had the same problem, but to no avail. I tried the following
int err = setsockopt(s_,SOL_SOCKET,SO_REUSEADDR,(char*)TRUE,sizeof(BOOL));
without success.
I use winsock 2.0, so WSADATA :: iMaxSockets should not enter the game, and in any case, I checked its set to 0 (I assume it means infinity)
4,000 requests do not seem like the wild number of requests that need to be made at application startup. Is there a way to use SO_KEEPALIVE on the client side while the server is constantly shutting down and reopening?
Am I missing something at all?
source share