diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-04-29 07:59:52 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-04-29 07:59:52 +0200 |
commit | a84a77a4861c8fc1b0b6d3ec0931e83395cb34b5 (patch) | |
tree | da4c789d742994a55f4d6627af7b727dbcf68994 /src/tcp_connecter.cpp | |
parent | b89d87787f8a388ebec038cd60a6c3db41919c41 (diff) |
Fix TCP/IPC socket shutdown
When socket in the process of asynchronous connect is being closed
and the fact that there is no peer is found out at the same time
close() may return ECONNRESET. This patch handles this situation
decently.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/tcp_connecter.cpp')
-rw-r--r-- | src/tcp_connecter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index d1c04db..de105bb 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -307,7 +307,7 @@ void xs::tcp_connecter_t::close () wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (s); - errno_assert (rc == 0); + errno_assert (rc == 0 || errno == ECONNRESET); #endif s = retired_fd; } |