Package org.zeromq
Class ZMQ.Context
- java.lang.Object
-
- org.zeromq.ZMQ.Context
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- ZMQ
public static class ZMQ.Context extends Object implements Closeable
Inner class: Context.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContext(int ioThreads)Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()protected voidconstruct(int ioThreads)Initialize the JNI interfaceprotected voiddestroy()Free all resources used by JNI interface.intgetMaxSockets()The maximum number of sockets allowed on the contextZMQ.Pollerpoller()Deprecated.use Poller constructorZMQ.Pollerpoller(int size)Deprecated.use Poller constructorbooleansetMaxSockets(int maxSockets)Sets the maximum number of sockets allowed on the contextZMQ.Socketsocket(int type)Create a new Socket within this context.voidterm()This is an explicit "destructor".
-
-
-
Method Detail
-
term
public void term()
This is an explicit "destructor". It can be called to ensure the corresponding 0MQ Context has been disposed of.
-
socket
public ZMQ.Socket socket(int type)
Create a new Socket within this context.- Parameters:
type- the socket type.- Returns:
- the newly created Socket.
-
poller
public ZMQ.Poller poller()
Deprecated.use Poller constructorCreate a new Poller within this context, with a default size.- Returns:
- the newly created Poller.
-
poller
public ZMQ.Poller poller(int size)
Deprecated.use Poller constructorCreate a new Poller within this context, with a specified initial size.- Parameters:
size- the poller initial size.- Returns:
- the newly created Poller.
-
construct
protected void construct(int ioThreads)
Initialize the JNI interface
-
destroy
protected void destroy()
Free all resources used by JNI interface.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
setMaxSockets
public boolean setMaxSockets(int maxSockets)
Sets the maximum number of sockets allowed on the context
-
getMaxSockets
public int getMaxSockets()
The maximum number of sockets allowed on the context
-
-