mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 07:56:09 +00:00
ZMQII-27: Allow setting SNDBUF and RCVBUF size from 0MQ API (Win32)
This commit is contained in:
parent
8d58643655
commit
986ab66b8f
@ -38,6 +38,21 @@ int zmq::tcp_socket_t::open (fd_t fd_, uint64_t sndbuf_, uint64_t rcvbuf_)
|
|||||||
{
|
{
|
||||||
zmq_assert (s == retired_fd);
|
zmq_assert (s == retired_fd);
|
||||||
s = fd_;
|
s = fd_;
|
||||||
|
|
||||||
|
if (sndbuf_) {
|
||||||
|
int sz = (int) sndbuf_;
|
||||||
|
int rc = setsockopt (s, SOL_SOCKET, SO_SNDBUF,
|
||||||
|
(char*) &sz, sizeof (int));
|
||||||
|
errno_assert (rc == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rcvbuf_) {
|
||||||
|
int sz = (int) rcvbuf_;
|
||||||
|
int rc = setsockopt (s, SOL_SOCKET, SO_RCVBUF,
|
||||||
|
(char*) &sz, sizeof (int));
|
||||||
|
errno_assert (rc == 0);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user