diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-02-16 10:01:02 +0900 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-02-16 10:01:02 +0900 |
commit | 061d0df60624bdcef571188fd7c7ecdcadf520eb (patch) | |
tree | 65c44005624d3886e75556b2f69e62527a41b497 /src/socket_base.cpp | |
parent | 6f32361fea61619fec94348de693a9e3ff8981e0 (diff) |
Socket ID added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r-- | src/socket_base.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 7293419..077d6e0 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2009-2011 250bpm s.r.o. + Copyright (c) 2009-2012 250bpm s.r.o. Copyright (c) 2007-2009 iMatix Corporation Copyright (c) 2011 VMware, Inc. Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file @@ -68,43 +68,43 @@ bool zmq::socket_base_t::check_tag () } zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_, - uint32_t tid_) + uint32_t tid_, int sid_) { socket_base_t *s = NULL; switch (type_) { case ZMQ_PAIR: - s = new (std::nothrow) pair_t (parent_, tid_); + s = new (std::nothrow) pair_t (parent_, tid_, sid_); break; case ZMQ_PUB: - s = new (std::nothrow) pub_t (parent_, tid_); + s = new (std::nothrow) pub_t (parent_, tid_, sid_); break; case ZMQ_SUB: - s = new (std::nothrow) sub_t (parent_, tid_); + s = new (std::nothrow) sub_t (parent_, tid_, sid_); break; case ZMQ_REQ: - s = new (std::nothrow) req_t (parent_, tid_); + s = new (std::nothrow) req_t (parent_, tid_, sid_); break; case ZMQ_REP: - s = new (std::nothrow) rep_t (parent_, tid_); + s = new (std::nothrow) rep_t (parent_, tid_, sid_); break; case ZMQ_XREQ: - s = new (std::nothrow) xreq_t (parent_, tid_); + s = new (std::nothrow) xreq_t (parent_, tid_, sid_); break; case ZMQ_XREP: - s = new (std::nothrow) xrep_t (parent_, tid_); + s = new (std::nothrow) xrep_t (parent_, tid_, sid_); break; case ZMQ_PULL: - s = new (std::nothrow) pull_t (parent_, tid_); + s = new (std::nothrow) pull_t (parent_, tid_, sid_); break; case ZMQ_PUSH: - s = new (std::nothrow) push_t (parent_, tid_); + s = new (std::nothrow) push_t (parent_, tid_, sid_); break; case ZMQ_XPUB: - s = new (std::nothrow) xpub_t (parent_, tid_); + s = new (std::nothrow) xpub_t (parent_, tid_, sid_); break; case ZMQ_XSUB: - s = new (std::nothrow) xsub_t (parent_, tid_); + s = new (std::nothrow) xsub_t (parent_, tid_, sid_); break; default: errno = EINVAL; @@ -114,7 +114,7 @@ zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_, return s; } -zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_) : +zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_, int sid_) : own_t (parent_, tid_), tag (0xbaddecaf), ctx_terminated (false), @@ -123,6 +123,7 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_) : ticks (0), rcvmore (false) { + options.socket_id = sid_; } zmq::socket_base_t::~socket_base_t () |