When programming communications using TClientSocket and TServerSocket in C++Builder, clients that use TClientSocket use TClientSocket-> The server using the TServerSocket side will sometimes report the error “” Asynchronous Socket Error 10053″ when the close disconnects and exits the program. Reference to the error instruction: Software caused Connection abort. This is a tricky one because you still can’t be sure where the problem is.
In fact, this error is largely the result of the TClientSocket dropping to Free without a client/server disconnect. There are two solutions here.
A: In the calling TClientSocket TClientSocket before the Close of the call. The Socket. The Close connection is broken, but it also has another problem, there is also did not receive complete data, the server at this time will still be submitted to the Asynchronous Socket error 10053 error, So the call TClientSocket. Socket. Can call again before the Close TClientSocket. Socket. ReceiveText will server sends the data to receive completely
Add the following code to the OnClientError event on the server:
if(ErrorCode==10053)
Socket->Close;
ErrorCode= 0;
Disconnect the connection and set the ErrorCode to 0. If you don’t, the error code is still 10053 even though the connection is disconnected, you’ll still pop up to report Asynchronous Socket Error 10053.
Original: https://blog.csdn.net/shuiyuanfengxing/article/details/8504139
Read More:
- What should be paid attention to in socket programming — bind socket error: address already in use
- filezilla Failed to create listen socket on port 21 for IPv4 solution
- Solution to the problem of no C / C + + option in the new project of eclipse
- Error C2664 in C + + compilation: cannot convert parameter 2 from “const char [5]” to “lpctstr” solution.
- Asynchronous loading JS does not allow the use of document write solution
- Vs fatal error C1083: unable to open include file: “sys / socket. H”: no such file
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- Solution to the segmentation fault of single chain table in C language
- Solution to error [error] LD returned 1 exit status in C language
- The solution for error: jump to label [-fpermissive] encountered in C
- Creating Server TCP listening socket 127.0.0.1:6379: bind: No error。。。 Solutions to problems encountered in startup
- The solution of “failed to load ldlinux. C32” in Linux system
- Solution to the flash of running result of dev C / C + +
- Design of MQ asynchronous collection report data
- The socket connection was aborted in WCF
- Failed to create Oracle Oracle home user solution appears in oracle12c installation
- Python TCP socket programming: send returns broken pipe error?
- The solution of console flash in C + +
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- [Windows] Socket Server Failed to bind, error 10048