diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-03-24 14:48:50 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-03-24 14:48:50 +0100 |
commit | 17e82a361121dc81c90e17f1382dff678537b651 (patch) | |
tree | 25896e0124cf0f247ca9e754021458b3d2eac01a /src/tcp_socket.cpp | |
parent | a2252de2bcecb672f09c8a5d0013cce23d1d404f (diff) |
ZMQ_SNDBUF and ZMQ_RCVBUF type changed to int
This mimics POSIX specification.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/tcp_socket.cpp')
-rw-r--r-- | src/tcp_socket.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tcp_socket.cpp b/src/tcp_socket.cpp index f1b1d19..924b0b0 100644 --- a/src/tcp_socket.cpp +++ b/src/tcp_socket.cpp @@ -35,22 +35,21 @@ zmq::tcp_socket_t::~tcp_socket_t () close (); } -int zmq::tcp_socket_t::open (fd_t fd_, uint64_t sndbuf_, uint64_t rcvbuf_) +int zmq::tcp_socket_t::open (fd_t fd_, int sndbuf_, int rcvbuf_) { zmq_assert (s == retired_fd); s = fd_; if (sndbuf_) { - int sz = (int) sndbuf_; int rc = setsockopt (s, SOL_SOCKET, SO_SNDBUF, - (char*) &sz, sizeof (int)); + (char*) &sndbuf_, sizeof (int)); errno_assert (rc == 0); } if (rcvbuf_) { int sz = (int) rcvbuf_; int rc = setsockopt (s, SOL_SOCKET, SO_RCVBUF, - (char*) &sz, sizeof (int)); + (char*) &rcvbuf_, sizeof (int)); errno_assert (rc == 0); } @@ -145,20 +144,18 @@ zmq::tcp_socket_t::~tcp_socket_t () close (); } -int zmq::tcp_socket_t::open (fd_t fd_, uint64_t sndbuf_, uint64_t rcvbuf_) +int zmq::tcp_socket_t::open (fd_t fd_, int sndbuf_, int rcvbuf_) { assert (s == retired_fd); s = fd_; if (sndbuf_) { - int sz = (int) sndbuf_; - int rc = setsockopt (s, SOL_SOCKET, SO_SNDBUF, &sz, sizeof (int)); + int rc = setsockopt (s, SOL_SOCKET, SO_SNDBUF, &sndbuf_, sizeof (int)); errno_assert (rc == 0); } if (rcvbuf_) { - int sz = (int) rcvbuf_; - int rc = setsockopt (s, SOL_SOCKET, SO_RCVBUF, &sz, sizeof (int)); + int rc = setsockopt (s, SOL_SOCKET, SO_RCVBUF, &rcvbuf_, sizeof (int)); errno_assert (rc == 0); } |