public class ZContext extends Object implements Closeable
| Constructor and Description |
|---|
ZContext()
Class Constructor
|
ZContext(int ioThreads) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeSelector(Selector selector)
Deprecated.
createSelector() was exposed by mistake. while waiting for the API to disappear, this method is provided to allow releasing resources. |
ZMQ.Poller |
createPoller(int size) |
Selector |
createSelector()
Deprecated.
this was exposed by mistake.
|
ZMQ.Socket |
createSocket(int type)
Deprecated.
|
ZMQ.Socket |
createSocket(SocketType 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.Socket |
fork(ZThread.IAttachedRunnable runnable,
Object... args)
Create an attached thread, An attached thread gets a ctx and a PAIR pipe back to its
parent.
|
ZMQ.Context |
getContext() |
int |
getIoThreads() |
int |
getLinger() |
List<ZMQ.Socket> |
getSockets()
Return a copy of the list of currently open sockets.
|
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(SocketType type)
type - socket type@Deprecated public ZMQ.Socket createSocket(int type)
createSocket(SocketType)type - socket type (see ZMQ static class members)public void destroySocket(ZMQ.Socket s)
s - org.zeromq.Socket object to destroy@Deprecated public Selector createSelector()
closeSelector(Selector).@Deprecated public void closeSelector(Selector selector)
createSelector() was exposed by mistake. while waiting for the API to disappear, this method is provided to allow releasing resources.selector - the selector to close. It needs to have been created by createSelector().public ZMQ.Poller createPoller(int size)
public static ZContext shadow(ZContext ctx)
ctx - Original ZContext to create shadow ofpublic ZMQ.Socket fork(ZThread.IAttachedRunnable runnable, Object... args)
runnable - attached threadargs - forked runnable argspublic 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 © 2020. All rights reserved.