Merge pull request #1341 from hintjens/master

Problem: issue #1144, 1377
This commit is contained in:
Richard Newton 2015-04-20 12:28:54 +01:00
commit 88ac63189c
2 changed files with 9 additions and 7 deletions

View File

@ -132,11 +132,14 @@ zmq::signaler_t::~signaler_t ()
const struct linger so_linger = { 1, 0 }; const struct linger so_linger = { 1, 0 };
int rc = setsockopt (w, SOL_SOCKET, SO_LINGER, int rc = setsockopt (w, SOL_SOCKET, SO_LINGER,
(const char *) &so_linger, sizeof so_linger); (const char *) &so_linger, sizeof so_linger);
wsa_assert (rc != SOCKET_ERROR); // Only check shutdown if WSASTARTUP was previously done
rc = closesocket (w); if (rc == 0 || WSAGetLastError () != WSANOTINITIALISED) {
wsa_assert (rc != SOCKET_ERROR); wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (r); rc = closesocket (w);
wsa_assert (rc != SOCKET_ERROR); wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (r);
wsa_assert (rc != SOCKET_ERROR);
}
#else #else
int rc = close_wait_ms (w); int rc = close_wait_ms (w);
errno_assert (rc == 0); errno_assert (rc == 0);

View File

@ -94,11 +94,10 @@ int main(int, char**) {
} }
if (iteration == 1) { if (iteration == 1) {
zmq_connect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_connect: %s\n", zmq_strerror(errno)); zmq_connect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_connect: %s\n", zmq_strerror(errno));
//zmq_connect(subSocket, "tcp://127.0.0.1:30010") && printf("zmq_connect: %s\n", zmq_strerror(errno)); msleep (SETTLE_TIME);
} }
if (iteration == 4) { if (iteration == 4) {
zmq_disconnect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_disconnect(%d): %s\n", errno, zmq_strerror(errno)); zmq_disconnect(subSocket, "inproc://someInProcDescriptor") && printf("zmq_disconnect(%d): %s\n", errno, zmq_strerror(errno));
//zmq_disconnect(subSocket, "tcp://127.0.0.1:30010") && printf("zmq_disconnect: %s\n", zmq_strerror(errno));
} }
if (iteration > 4 && rc == 0) if (iteration > 4 && rc == 0)
break; break;