mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-15 15:16:52 +02:00
Set socket buffers before establishing TCP connection
The window scale option carried in SYN segment is computed from socket's receive buffer size. So we need to set this buffer size before calling connect or bind.
This commit is contained in:
@@ -226,6 +226,12 @@ int zmq::tcp_connecter_t::open ()
|
||||
// Set the socket to non-blocking mode so that we get async connect().
|
||||
unblock_socket (s);
|
||||
|
||||
// Set the socket buffer limits for the underlying socket.
|
||||
if (options.sndbuf != 0)
|
||||
set_tcp_send_buffer (s, options.sndbuf);
|
||||
if (options.rcvbuf != 0)
|
||||
set_tcp_receive_buffer (s, options.rcvbuf);
|
||||
|
||||
// Connect to the remote peer.
|
||||
int rc = ::connect (
|
||||
s, addr->resolved.tcp_addr->addr (),
|
||||
|
Reference in New Issue
Block a user