diff options
| author | Martin Sustrik <sustrik@250bpm.com> | 2011-07-28 13:19:55 +0200 | 
|---|---|---|
| committer | Martin Sustrik <sustrik@250bpm.com> | 2011-07-28 13:19:55 +0200 | 
| commit | 5ac63140b01fed145fa41f613308e134420920ab (patch) | |
| tree | e51f1dcd4c97ffb720c909f81271751d5776d191 /src/socket_base.cpp | |
| parent | 6e987428d49558a8a7b08795bcc429f720bb3874 (diff) | |
Implementations of TCP and IPC transports separated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/socket_base.cpp')
| -rw-r--r-- | src/socket_base.cpp | 16 | 
1 files changed, 15 insertions, 1 deletions
| diff --git a/src/socket_base.cpp b/src/socket_base.cpp index fb0f5fd..975934f 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -35,6 +35,7 @@  #include "socket_base.hpp"  #include "tcp_listener.hpp" +#include "ipc_listener.hpp"  #include "vtcp_listener.hpp"  #include "tcp_connecter.hpp"  #include "io_thread.hpp" @@ -363,7 +364,7 @@ int zmq::socket_base_t::bind (const char *addr_)          return -1;      } -    if (protocol == "tcp" || protocol == "ipc") { +    if (protocol == "tcp") {          tcp_listener_t *listener = new (std::nothrow) tcp_listener_t (              io_thread, this, options);          alloc_assert (listener); @@ -376,6 +377,19 @@ int zmq::socket_base_t::bind (const char *addr_)          return 0;      } +    if (protocol == "ipc") { +        ipc_listener_t *listener = new (std::nothrow) ipc_listener_t ( +            io_thread, this, options); +        alloc_assert (listener); +        int rc = listener->set_address (protocol.c_str(), address.c_str ()); +        if (rc != 0) { +            delete listener; +            return -1; +        } +        launch_child (listener); +        return 0; +    } +  #if defined ZMQ_HAVE_VTCP      if (protocol == "vtcp") {          vtcp_listener_t *listener = new (std::nothrow) vtcp_listener_t ( | 
