C# Class NetMQ.Core.Ctx

Objects of class Ctx are intended to encapsulate all of the global state associated with the NetMQ library. This contains the sockets, and manages interaction between them.
Internal analog of the public NetMQContext class.
Show file Open project: NetMQ/NetMQ3-x Class Usage Examples

Public Methods

Method Description
CheckDisposed ( ) : void

Throws ObjectDisposedException if this is already disposed.

DestroySocket ( [ socket ) : void

Destroy the given socket - which means to remove it from the list of active sockets, and add it to the list of unused sockets to be terminated.

If this was the last socket, then stop the reaper.

GetReaper ( ) : ZObject

Returns reaper thread object.

RegisterEndpoint ( [ address, [ endpoint ) : bool

Save the given address and Endpoint within our internal list. This is used for management of inproc endpoints.

SendCommand ( int threadId, [ command ) : void

Send a command to the given destination thread.

Terminate ( ) : void

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 after the last one is closed.

UnregisterEndpoint ( [ address, [ socket ) : bool

Un-register the given address/socket, by removing it from the contained list of endpoints.

UnregisterEndpoints ( [ socket ) : void

Remove from the list of endpoints, all endpoints that reference the given socket.

Private Methods

Method Description
ChooseIOThread ( long affinity ) : NetMQ.Core.IOThread
CreateSocket ( ZmqSocketType type ) : SocketBase
FindEndpoint ( [ addr ) : Endpoint

Method Details

CheckDisposed() public method

Throws ObjectDisposedException if this is already disposed.
This object has already been disposed.
public CheckDisposed ( ) : void
return void

DestroySocket() public method

Destroy the given socket - which means to remove it from the list of active sockets, and add it to the list of unused sockets to be terminated.
If this was the last socket, then stop the reaper.
public DestroySocket ( [ socket ) : void
socket [ the socket to destroy
return void

GetReaper() public method

Returns reaper thread object.
public GetReaper ( ) : ZObject
return ZObject

RegisterEndpoint() public method

Save the given address and Endpoint within our internal list. This is used for management of inproc endpoints.
public RegisterEndpoint ( [ address, [ endpoint ) : bool
address [ the textual name to give this endpoint
endpoint [ the Endpoint to remember
return bool

SendCommand() public method

Send a command to the given destination thread.
public SendCommand ( int threadId, [ command ) : void
threadId int
command [
return void

Terminate() public method

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 after the last one is closed.
public Terminate ( ) : void
return void

UnregisterEndpoint() public method

Un-register the given address/socket, by removing it from the contained list of endpoints.
public UnregisterEndpoint ( [ address, [ socket ) : bool
address [ the (string) address denoting the endpoint to unregister
socket [ the socket associated with that endpoint
return bool

UnregisterEndpoints() public method

Remove from the list of endpoints, all endpoints that reference the given socket.
public UnregisterEndpoints ( [ socket ) : void
socket [ the socket to remove all references to
return void