6 #if defined ZMQ_HAVE_IPC
19 #if defined ZMQ_HAVE_WINDOWS
23 #include <sys/types.h>
24 #include <sys/socket.h>
28 zmq::ipc_connecter_t::ipc_connecter_t (
class io_thread_t *io_thread_,
29 class session_base_t *session_,
32 bool delayed_start_) :
33 stream_connecter_base_t (
34 io_thread_, session_,
options_, addr_, delayed_start_)
36 zmq_assert (_addr->protocol == protocol_name::ipc);
39 void zmq::ipc_connecter_t::out_event ()
41 const fd_t fd = connect ();
47 add_reconnect_timer ();
54 void zmq::ipc_connecter_t::start_connecting ()
57 const int rc = open ();
61 _handle = add_fd (_s);
67 _handle = add_fd (_s);
68 set_pollout (_handle);
69 _socket->event_connect_delayed (
88 add_reconnect_timer ();
92 int zmq::ipc_connecter_t::open ()
105 const int rc = ::connect (_s, _addr->resolved.ipc_addr->addr (),
106 _addr->resolved.ipc_addr->addrlen ());
114 #ifdef ZMQ_HAVE_WINDOWS
115 const int last_error = WSAGetLastError ();
116 if (last_error == WSAEINPROGRESS || last_error == WSAEWOULDBLOCK)
119 errno = wsa_error_to_errno (last_error);
130 zmq::fd_t zmq::ipc_connecter_t::connect ()
136 const int rc = getsockopt (_s, SOL_SOCKET, SO_ERROR,
137 reinterpret_cast<char *
> (&
err), &
len);
139 if (
errno == ENOPROTOOPT)
154 const fd_t result = _s;