summaryrefslogtreecommitdiff
path: root/src/tcp_listener.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-10-17 10:23:58 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-10-17 10:23:58 +0200
commita780833683ed1f5bc4a112644836973f8282434b (patch)
tree1dbfad92c986294a2d6372fc7a65b74851c52102 /src/tcp_listener.cpp
parente8e2944f45eab3e22dc46ceac3225a886ca468ad (diff)
ZMQ_BACKLOG socket option added.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/tcp_listener.cpp')
-rw-r--r--src/tcp_listener.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp
index a62bc04..3766682 100644
--- a/src/tcp_listener.cpp
+++ b/src/tcp_listener.cpp
@@ -42,7 +42,8 @@ zmq::tcp_listener_t::~tcp_listener_t ()
close ();
}
-int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
+int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_,
+ int backlog_)
{
// IPC protocol is not supported on Windows platform.
if (strcmp (protocol_, "tcp") != 0 ) {
@@ -81,7 +82,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
}
// Listen for incomming connections.
- rc = listen (s, 1);
+ rc = listen (s, backlog_);
if (rc == SOCKET_ERROR) {
wsa_error_to_errno ();
return -1;
@@ -161,7 +162,8 @@ zmq::tcp_listener_t::~tcp_listener_t ()
close ();
}
-int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
+int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_,
+ int backlog_)
{
if (strcmp (protocol_, "tcp") == 0 ) {
@@ -201,7 +203,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
}
// Listen for incomming connections.
- rc = listen (s, tcp_connection_backlog);
+ rc = listen (s, backlog_);
if (rc != 0) {
close ();
return -1;
@@ -241,7 +243,7 @@ int zmq::tcp_listener_t::set_address (const char *protocol_, const char *addr_)
}
// Listen for incomming connections.
- rc = listen (s, tcp_connection_backlog);
+ rc = listen (s, backlog_);
if (rc != 0) {
close ();
return -1;