Qore zmq Module  1.0.0
Qore::ZMQ::ZContext Class Reference

The ZContext class implements a ZeroMQ context. More...

Public Member Methods

 constructor ()
 constructs a ZContext object More...
 
 copy ()
 Throws an exception; ZContext objects cannot be copied. More...
 
int getOption (int opt)
 Retrieves the value of the given option on the context. More...
 
nothing setOption (int opt, int value)
 Sets the given option on the context. More...
 
nothing shutdown ()
 Shuts the context down. More...
 

Detailed Description

The ZContext class implements a ZeroMQ context.

Restrictions:
Qore::PO_NO_NETWORK

The context is terminated in the destructor

Member Function Documentation

◆ constructor()

Qore::ZMQ::ZContext::constructor ( )

constructs a ZContext object

Example:
ZContext ctx();

◆ copy()

Qore::ZMQ::ZContext::copy ( )

Throws an exception; ZContext objects cannot be copied.

Exceptions
ZCONTEXT-COPY-ERRORthis exception is thrown if any attempt is made to copy a ZContext object

◆ getOption()

int Qore::ZMQ::ZContext::getOption ( int  opt)

Retrieves the value of the given option on the context.

Code Flags:
RET_VALUE_ONLY
Example:
int val = ctx.getOption(ZMQ_IPV6);
Parameters
optthe option number; see ZContext Options for possible values
Returns
the integer value of the given option
Exceptions
ZCONTEXT-GETOPTION-ERRORthis exception is thrown if there is any error setting the option

◆ setOption()

nothing Qore::ZMQ::ZContext::setOption ( int  opt,
int  value 
)

Sets the given option on the context.

Example:
ctx.setOption(ZMQ_IPV6, 1);
Parameters
optthe option number; see ZContext Options for possible values
valuethe integer value to set
Exceptions
ZCONTEXT-SETOPTION-ERRORthis exception is thrown if there is any error setting the option

◆ shutdown()

nothing Qore::ZMQ::ZContext::shutdown ( )

Shuts the context down.

Example:
ctx.shutdown();

Context shutdown will cause any blocking operations currently in progress on sockets open within context to return immediately with an error code of ETERM which causes a Qore-language exception to be raised..

With the exception of closing the socket, any further operations on sockets open within context shall fail with an error code of ETERM, causing Qore- language exceptions to be thrown.

Exceptions
ZCONTEXT-SHUTDOWN-ERRORthis exception is thrown if there is any error in this method call

The documentation for this class was generated from the following file: