The server got stuck when I was doing the test yesterday. I found that the server did not return the message when it called the send function. As a result, the thread of message processing was stuck there.
Based on the online data, I can probably tell that either the sender is out of cache or the receiver is out of cache.
And my socket is not set to non-blocking mode, so it’s stuck here with no return.
The solution is to change the socket to non-blocking mode
Based on the online data, I can probably tell that either the sender is out of cache or the receiver is out of cache.
And my socket is not set to non-blocking mode, so it’s stuck here with no return.
The solution is to change the socket to non-blocking mode
In this way, if the send fails, it can return immediately, and the server won’t be stuck there.
At this time, if the send is unsuccessful, the return value of the send is error 10035.
Then I checked the test client and realized that my client did not receive at all.
That’s weird.
Read More:
- What should be paid attention to in socket programming — bind socket error: address already in use
- Socket error 10053
- Python TCP socket programming: send returns broken pipe error?
- Socket Error 104 bug
- [Windows] Socket Server Failed to bind, error 10048
- Could not sync socket: %1
- The socket connection was aborted in WCF
- [PHP]stream_socket_client(): Failed to enable crypto
- filezilla Failed to create listen socket on port 21 for IPv4 solution
- Error condition on socket for Sync: connection reused
- [Solved] Rabbitmq Warning: java.net.SocketException: socket closed
- [Solved] socket.gaierror: [Errno 8] nodename nor servname provided, or not known
- Nodejs HTTP call error: socket hang up
- Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
- A solution to the error of asynchronous socket error 10053 in C + + Builder
- ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded How to Fix
- About connection reset by peer: socket write error
- [resolved] exception java.net.ConnectException : Error opening socket to server Connection timed out.
- java.net.SocketException: socket failed: EPERM (Operation not permitted)
- java.sql.SQLException : IO exception: socket read timed out