Package org.zeromq
Class ZMQ.Context
java.lang.Object
org.zeromq.ZMQ.Context
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- ZMQ
Inner class: Context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
construct
(int ioThreads) Initialize the JNI interfaceprotected void
destroy()
Free all resources used by JNI interface.int
The maximum number of sockets allowed on the contextpoller()
Deprecated.use Poller constructorpoller
(int size) Deprecated.use Poller constructorboolean
setMaxSockets
(int maxSockets) Sets the maximum number of sockets allowed on the contextsocket
(int type) Create a new Socket within this context.void
term()
This is an explicit "destructor".
-
Constructor Details
-
Context
protected Context(int ioThreads) Class constructor.- Parameters:
ioThreads
- size of the threads pool to handle I/O operations.
-
-
Method Details
-
term
public void term()This is an explicit "destructor". It can be called to ensure the corresponding 0MQ Context has been disposed of. -
socket
Create a new Socket within this context.- Parameters:
type
- the socket type.- Returns:
- the newly created Socket.
-
poller
Deprecated.use Poller constructorCreate a new Poller within this context, with a default size.- Returns:
- the newly created Poller.
-
poller
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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-