I have not been very clear explaining the problem. Sorry
Actual RawConnect() function do not report the real cause of the error. This is due to:
- It just do a SetSockError("connect", -1, "failed");
- As Close() is called every connection try, the error cause is deleted, so no function out of RawConnect() can know it.
A way to improve the function could be to get the source of the problem with GetErrorCode() and TcpSocketErrorDesc() before doing the Close().
In my case I had a buffer overflow error (WSAENOBUFS in Windows). The only way I had to know it was patching the function. Without knowing a problem root cause it is difficult to solve it