First attempt at inproc connect before bind

This commit is contained in:
Richard Newton
2013-09-12 14:44:44 +01:00
parent 8e6b5ad17e
commit 5f20d63665
9 changed files with 270 additions and 40 deletions

View File

@@ -40,6 +40,7 @@ namespace zmq
class io_thread_t;
class socket_base_t;
class reaper_t;
class pipe_t;
// Information associated with inproc endpoint. Note that endpoint options
// are registered as well so that the peer can access them without a need
@@ -50,6 +51,12 @@ namespace zmq
options_t options;
};
struct pending_connection_t
{
socket_base_t *socket;
pipe_t* pipe;
};
// Context object encapsulates all the global state associated with
// the library.
@@ -101,6 +108,8 @@ namespace zmq
int register_endpoint (const char *addr_, endpoint_t &endpoint_);
void unregister_endpoints (zmq::socket_base_t *socket_);
endpoint_t find_endpoint (const char *addr_);
void pend_connection (const char *addr_, const pending_connection_t &pending_connection_);
pending_connection_t next_pending_connection (const char *addr_);
enum {
term_tid = 0,
@@ -156,6 +165,10 @@ namespace zmq
typedef std::map <std::string, endpoint_t> endpoints_t;
endpoints_t endpoints;
// List of inproc connection endpoints pending a bind
typedef std::map <std::string, pending_connection_t> pending_connections_t;
pending_connections_t pending_connections;
// Synchronisation of access to the list of inproc endpoints.
mutex_t endpoints_sync;