Error in recv()
-
Hi, I have created a TCP connection between client and server. On client system I do socket(), bind(), connect() and recv()/send(). I do recv() and send() simultaneously in two threads. The program works fine for some time (1-2 minutes), but after some time, recv() returns SOCKET_ERROR. WSAGetLastError() returns error code of 12. Any suggestions on how to solve this problem? I am sending about 20 packets per second (at a rate of 100kbps). I am receiving about same number of packets although bitrate is much lesser. Any help will be highly appreciated. Thanks very much in advance. Regards RS
-
Hi, I have created a TCP connection between client and server. On client system I do socket(), bind(), connect() and recv()/send(). I do recv() and send() simultaneously in two threads. The program works fine for some time (1-2 minutes), but after some time, recv() returns SOCKET_ERROR. WSAGetLastError() returns error code of 12. Any suggestions on how to solve this problem? I am sending about 20 packets per second (at a rate of 100kbps). I am receiving about same number of packets although bitrate is much lesser. Any help will be highly appreciated. Thanks very much in advance. Regards RS
What are the sizes of the packets? Do they change? You need to print the error message text. I think 12 is: WSAEMSGSIZE The message was too large to fit into the specified buffer and was truncated. But I'm not sure. The above is in the MSDN for recv(). FUNNY, I am chasing a recv() error right now myself! My post is just a few after yours :-)
-
What are the sizes of the packets? Do they change? You need to print the error message text. I think 12 is: WSAEMSGSIZE The message was too large to fit into the specified buffer and was truncated. But I'm not sure. The above is in the MSDN for recv(). FUNNY, I am chasing a recv() error right now myself! My post is just a few after yours :-)
> What are the sizes of the packets? > Do they change? Initially the packet sizes are about 8-10 bytes. Later packet sizes increase to 600-800 bytes. When the packet size is small and packets per second are low, the error is generated after a longer time. When packet size increases the error is generated in a very short time. Also I am using TCP port 80.
-
> What are the sizes of the packets? > Do they change? Initially the packet sizes are about 8-10 bytes. Later packet sizes increase to 600-800 bytes. When the packet size is small and packets per second are low, the error is generated after a longer time. When packet size increases the error is generated in a very short time. Also I am using TCP port 80.