Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Telford Berkey committed Apr 21, 2015
2 parents ee4e6bd + cd830dd commit df522ab
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ case "${host_os}" in
AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
fi
;;
*openbsd*)
*openbsd*|*bitrig*)
# Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
Expand All @@ -245,7 +245,7 @@ case "${host_os}" in
LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Ae])
AC_CHECK_FUNCS(gethrtime)
;;
*mingw32*)
*mingw*)
AC_DEFINE(ZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
AC_DEFINE(ZMQ_HAVE_MINGW32, 1, [Have MinGW32])
AC_CHECK_HEADERS(windows.h)
Expand Down
15 changes: 15 additions & 0 deletions doc/zmq_setsockopt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,21 @@ Option value unit:: 0, 1
Default value:: 0
Applicable socket types:: ZMQ_XPUB

ZMQ_XPUB_NODROP: do not silently drop messages if SENDHWM is reached
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the 'XPUB' socket behaviour to return error EAGAIN if SENDHWM is
reached and the message could not be send.

A value of `0` is the default and drops the message silently when the peers
SNDHWM is reached. A value of `1` returns an 'EAGAIN' error code if the
SNDHWM is reached and ZMQ_DONTWAIT was used.

[horizontal]
Option value type:: int
Option value unit:: 0, 1
Default value:: 0
Applicable socket types:: ZMQ_XPUB, ZMQ_PUB

ZMQ_WELCOME_MSG: set welcome message that will be received by subscriber when connecting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
13 changes: 8 additions & 5 deletions src/signaler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ zmq::signaler_t::~signaler_t ()
const struct linger so_linger = { 1, 0 };
int rc = setsockopt (w, SOL_SOCKET, SO_LINGER,
(const char *) &so_linger, sizeof so_linger);
wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (w);
wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (r);
wsa_assert (rc != SOCKET_ERROR);
// Only check shutdown if WSASTARTUP was previously done
if (rc == 0 || WSAGetLastError () != WSANOTINITIALISED) {
wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (w);
wsa_assert (rc != SOCKET_ERROR);
rc = closesocket (r);
wsa_assert (rc != SOCKET_ERROR);
}
#else
int rc = close_wait_ms (w);
errno_assert (rc == 0);
Expand Down
3 changes: 1 addition & 2 deletions tests/test_disconnect_inproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ int main(int, char**) {
}
if (iteration == 1) {
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) {
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)
break;
Expand Down

0 comments on commit df522ab

Please sign in to comment.