ext/zeromq/src/tcp.cpp in rbczmq-1.7.1 vs ext/zeromq/src/tcp.cpp in rbczmq-1.7.2

- old
+ new

@@ -1,9 +1,7 @@ /* - Copyright (c) 2010-2011 250bpm s.r.o. - Copyright (c) 2007-2009 iMatix Corporation - Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file + Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -56,9 +54,31 @@ // Disable delayed acknowledgements as they hurt latency is serious manner. int nodelack = 1; rc = setsockopt (s_, IPPROTO_TCP, TCP_NODELACK, (char*) &nodelack, sizeof (int)); errno_assert (rc != SOCKET_ERROR); +#endif +} + +void zmq::set_tcp_send_buffer (fd_t sockfd_, int bufsize_) +{ + const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_SNDBUF, + (char*) &bufsize_, sizeof bufsize_); +#ifdef ZMQ_HAVE_WINDOWS + wsa_assert (rc != SOCKET_ERROR); +#else + errno_assert (rc == 0); +#endif +} + +void zmq::set_tcp_receive_buffer (fd_t sockfd_, int bufsize_) +{ + const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_RCVBUF, + (char*) &bufsize_, sizeof bufsize_); +#ifdef ZMQ_HAVE_WINDOWS + wsa_assert (rc != SOCKET_ERROR); +#else + errno_assert (rc == 0); #endif } void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_) {