public class ZContext extends Object implements Closeable
| Constructor and Description |
|---|
ZContext()
Class Constructor
|
ZContext(int ioThreads) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ZMQ.Poller |
createPoller(int size) |
Selector |
createSelector() |
ZMQ.Socket |
createSocket(int type)
Creates a new managed socket within this ZContext instance.
|
void |
destroy()
Destructor.
|
void |
destroySocket(ZMQ.Socket s)
Destroys managed socket within this context
and remove from sockets list
|
ZMQ.Context |
getContext() |
int |
getIoThreads() |
int |
getLinger() |
List<ZMQ.Socket> |
getSockets() |
boolean |
isClosed() |
boolean |
isMain() |
void |
setContext(ZMQ.Context ctx)
Deprecated.
This value should not be changed after the ZContext is initialized.
|
void |
setIoThreads(int ioThreads)
Deprecated.
This value should not be changed after the context is initialized.
|
void |
setLinger(int linger) |
void |
setMain(boolean main)
Deprecated.
This value should not be changed after the context is initialized.
|
void |
setRcvHWM(int rcvhwm)
Set initial receive HWM for all new normal sockets created in context.
|
void |
setSndHWM(int sndhwm)
Set initial receive HWM for all new normal sockets created in context.
|
static ZContext |
shadow(ZContext ctx)
Creates new shadow context.
|
public ZContext()
public ZContext(int ioThreads)
public void destroy()
public ZMQ.Socket createSocket(int type)
type - socket type (see ZMQ static class members)public void destroySocket(ZMQ.Socket s)
s - org.zeromq.Socket object to destroypublic Selector createSelector()
public ZMQ.Poller createPoller(int size)
public static ZContext shadow(ZContext ctx)
ctx - Original ZContext to create shadow ofpublic int getIoThreads()
@Deprecated public void setIoThreads(int ioThreads)
ioThreads - the number of ioThreads to setpublic int getLinger()
public void setLinger(int linger)
linger - the linger to setpublic void setRcvHWM(int rcvhwm)
rcvhwm - the rcvhwmpublic void setSndHWM(int sndhwm)
sndhwm - the sndhwmpublic boolean isMain()
@Deprecated public void setMain(boolean main)
main - whether or not the context is being set to mainpublic ZMQ.Context getContext()
@Deprecated public void setContext(ZMQ.Context ctx)
ctx - sets the underlying zmq.Context associated with this ZContext wrapper objectpublic List<ZMQ.Socket> getSockets()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
Copyright © 2017. All rights reserved.