diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 8d2de8e5..2e57ec3c 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -156,6 +156,12 @@ zmq::stream_engine_t::~stream_engine_t () wsa_assert (rc != SOCKET_ERROR); #else int rc = close (s); +#ifdef __FreeBSD_kernel__ + // FreeBSD may return ECONNRESET on close() under load but this is not + // an error. + if (rc == -1 && errno == ECONNRESET) + rc = 0; +#endif errno_assert (rc == 0); #endif s = retired_fd;