Run-time checking for context & socket validity added

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik
2011-04-09 09:35:34 +02:00
parent e62686aca5
commit b96fe15bb6
14 changed files with 62 additions and 32 deletions

View File

@@ -60,6 +60,9 @@ namespace zmq
// of I/O thread pool to create.
ctx_t (uint32_t io_threads_);
// Returns false if object is not a context.
bool check_tag ();
// This function is called when user invokes zmq_term. If there are
// no more sockets open it'll cause all the infrastructure to be shut
// down. If there are open sockets still, the deallocation happens
@@ -98,6 +101,9 @@ namespace zmq
~ctx_t ();
// Used to check whether the object is a context.
uint32_t tag;
// Sockets belonging to this context. We need the list so that
// we can notify the sockets when zmq_term() is called. The sockets
// will return ETERM then.