mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-12 03:07:53 +01:00
Implementations of TCP and IPC transports separated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -87,6 +87,26 @@ void zmq::tcp_listener_t::in_event ()
|
||||
if (fd == retired_fd)
|
||||
return;
|
||||
|
||||
// Disable Nagle's algorithm. We are doing data batching on 0MQ level,
|
||||
// so using Nagle wouldn't improve throughput in anyway, but it would
|
||||
// hurt latency.
|
||||
int nodelay = 1;
|
||||
int rc = setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (char*) &nodelay,
|
||||
sizeof (int));
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
#else
|
||||
errno_assert (rc == 0);
|
||||
#endif
|
||||
|
||||
#ifdef ZMQ_HAVE_OPENVMS
|
||||
// Disable delayed acknowledgements as they hurt latency is serious manner.
|
||||
int nodelack = 1;
|
||||
rc = setsockopt (fd, IPPROTO_TCP, TCP_NODELACK, (char*) &nodelack,
|
||||
sizeof (int));
|
||||
errno_assert (rc != SOCKET_ERROR);
|
||||
#endif
|
||||
|
||||
// Create the engine object for this connection.
|
||||
tcp_engine_t *engine = new (std::nothrow) tcp_engine_t (fd, options);
|
||||
alloc_assert (engine);
|
||||
|
||||
Reference in New Issue
Block a user