public static class ZMQ.Socket extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
ZMQ.Socket.Mechanism |
| Modifier | Constructor and Description |
|---|---|
protected |
ZMQ.Socket(SocketBase base) |
protected |
ZMQ.Socket(ZMQ.Context context,
int type)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SocketBase |
base()
DO NOT USE if you're trying to build a special proxy
|
boolean |
bind(String addr)
Bind to network interface.
|
int |
bindToRandomPort(String addr)
Bind to network interface to a random port.
|
int |
bindToRandomPort(String addr,
int min,
int max)
Bind to network interface to a random port.
|
void |
close()
This is an explicit "destructor".
|
boolean |
connect(String addr)
Connect to remote application.
|
boolean |
disconnect(String addr)
Disconnect from remote application.
|
int |
errno() |
long |
getAffinity() |
boolean |
getAsServerCurve()
Deprecated.
the naming is inconsistent with jzmq, please use
getCurveServer() instead |
boolean |
getAsServerPlain()
Deprecated.
the naming is inconsistent with jzmq, please use
getPlainServer() instead |
int |
getBacklog()
The ZMQ_BACKLOG option shall retrieve the maximum length of the queue
of outstanding peer connections for the specified socket;
this only applies to connection-oriented transports.
|
boolean |
getConflate()
If in conflate mode, a socket shall keep only one message in its inbound/outbound queue,
this message being the last message received/the last message to be sent.
|
byte[] |
getCurvePublicKey()
Retrieves the current long term public key for the socket in binary format of 32 bytes.
|
byte[] |
getCurveSecretKey()
Retrieves the current long term secret key for the socket in binary format of 32 bytes.
|
boolean |
getCurveServer()
Tells if the socket will act as server for CURVE security.
|
byte[] |
getCurveServerKey()
Retrieves the current server key for the socket in binary format of 32 bytes.
|
boolean |
getDelayAttachOnConnect()
Deprecated.
use
setImmediate(boolean) instead (inverted logic: immediate = true <==> delay attach on connect = false) |
int |
getEvents()
The 'ZMQ_EVENTS' option shall retrieve event flags for the specified socket.
|
SelectableChannel |
getFD()
The 'ZMQ_FD' option shall retrieve file descriptor associated with the 0MQ
socket.
|
int |
getHandshakeIvl()
The ZMQ_HANDSHAKE_IVL option shall retrieve the maximum handshake interval
for the specified socket.
|
int |
getHWM()
Deprecated.
|
byte[] |
getIdentity() |
boolean |
getImmediate()
Retrieve the state of the attach on connect value.
|
boolean |
getIPv4Only()
Deprecated.
use
isIPv6() instead (inverted logic: ipv4 = true <==> ipv6 = false) |
boolean |
getIPv6()
Retrieve the IPv6 option for the socket.
|
String |
getLastEndpoint()
The ZMQ_LAST_ENDPOINT option shall retrieve the last endpoint bound for TCP and IPC transports.
|
int |
getLinger()
The 'ZMQ_LINGER' option shall retrieve the period for pending outbound
messages to linger in memory after closing the socket.
|
long |
getMaxMsgSize()
The option shall retrieve limit for the inbound messages.
|
ZMQ.Socket.Mechanism |
getMechanism()
The ZMQ_MECHANISM option shall retrieve the current security mechanism for the socket.
|
int |
getMsgAllocationHeapThreshold()
Gets the limit threshold where messages of a given size will be allocated using Direct ByteBuffer.
|
long |
getMulticastHops() |
String |
getPlainPassword()
The ZMQ_PLAIN_PASSWORD option shall retrieve the last password
set for the PLAIN security mechanism.
|
boolean |
getPlainServer()
Returns the ZMQ_PLAIN_SERVER option, if any, previously set on the socket.
|
String |
getPlainUsername()
The ZMQ_PLAIN_USERNAME option shall retrieve the last username
set for the PLAIN security mechanism.
|
long |
getRate() |
int |
getRcvHWM()
The ZMQ_RCVHWM option shall return the high water mark for inbound messages on the specified socket.
|
int |
getReceiveBufferSize()
The ZMQ_RCVBUF option shall retrieve the underlying kernel receive buffer size for the specified socket.
|
int |
getReceiveTimeOut()
Retrieve the timeout for recv operation on the socket.
|
int |
getReconnectIVL()
The ZMQ_RECONNECT_IVL option shall retrieve the initial reconnection interval for the specified socket.
|
int |
getReconnectIVLMax()
The ZMQ_RECONNECT_IVL_MAX option shall retrieve the maximum reconnection interval for the specified socket.
|
long |
getRecoveryInterval()
The ZMQ_RECOVERY_IVL option shall retrieve the recovery interval for multicast transports
using the specified socket.
|
boolean |
getReqCorrelate()
Deprecated.
|
boolean |
getReqRelaxed()
Deprecated.
|
int |
getSendBufferSize()
The ZMQ_SNDBUF option shall retrieve the underlying kernel transmit buffer size for the specified socket.
|
int |
getSendTimeOut()
Retrieve the timeout for send operation on the socket.
|
int |
getSndHWM()
The ZMQ_SNDHWM option shall return the high water mark for outbound messages on the specified socket.
|
String |
getSocksProxy()
The ZMQ_SOCKS_PROXY option shall retrieve the SOCKS5 proxy address in string format.
|
long |
getSwap()
Deprecated.
|
int |
getTCPKeepAlive() |
long |
getTCPKeepAliveCount() |
long |
getTCPKeepAliveIdle() |
long |
getTCPKeepAliveInterval() |
long |
getTCPKeepAliveSetting()
Deprecated.
|
int |
getTos()
Retrieve the IP_TOS option for the socket.
|
int |
getType()
The 'ZMQ_TYPE option shall retrieve the socket type for the specified
'socket'.
|
String |
getZapDomain()
The ZMQ_ZAP_DOMAIN option shall retrieve the last ZAP domain set for the socket.
|
String |
getZAPDomain()
The ZMQ_ZAP_DOMAIN option shall retrieve the last ZAP domain set for the socket.
|
boolean |
hasMulticastLoop()
Deprecated.
|
boolean |
hasReceiveMore()
The 'ZMQ_RCVMORE' option shall return a boolean value indicating if the multi-part
message currently being read from the specified 'socket' has more message parts to
follow.
|
boolean |
isAsServerCurve()
Deprecated.
the naming is inconsistent with jzmq, please use
getCurveServer() instead |
boolean |
isAsServerPlain()
Deprecated.
the naming is inconsistent with jzmq, please use
getPlainServer() instead |
boolean |
isConflate()
If in conflate mode, a socket shall keep only one message in its inbound/outbound queue,
this message being the last message received/the last message to be sent.
|
boolean |
isImmediate()
Retrieve the state of the attach on connect value.
|
boolean |
isIPv6()
Retrieve the IPv6 option for the socket.
|
boolean |
monitor(String addr,
int events)
Start a monitoring socket where events can be received.
|
byte[] |
recv()
Receive a message.
|
int |
recv(byte[] buffer,
int offset,
int len,
int flags)
Receive a message in to a specified buffer.
|
byte[] |
recv(int flags)
Receive a message.
|
int |
recvByteBuffer(ByteBuffer buffer,
int flags)
Receive a message into the specified ByteBuffer
|
String |
recvStr() |
String |
recvStr(int flags) |
boolean |
send(byte[] data) |
boolean |
send(byte[] data,
int flags) |
boolean |
send(byte[] data,
int off,
int length,
int flags) |
boolean |
send(String data) |
boolean |
send(String data,
int flags) |
int |
sendByteBuffer(ByteBuffer data,
int flags)
Send a message
|
boolean |
sendMore(byte[] data) |
boolean |
sendMore(String data) |
boolean |
setAffinity(long value)
Get the Affinity.
|
boolean |
setAsServerCurve(boolean server)
Deprecated.
the naming is inconsistent with jzmq, please use
setCurveServer(boolean) instead |
boolean |
setAsServerPlain(boolean server)
Deprecated.
the naming is inconsistent with jzmq, please use
setPlainServer(boolean) instead |
boolean |
setBacklog(int value)
The ZMQ_BACKLOG option shall set the maximum length
of the queue of outstanding peer connections for the specified socket;
this only applies to connection-oriented transports.
|
boolean |
setBacklog(long value)
Deprecated.
this option uses integer range, use
setBacklog(int) instead. |
boolean |
setConflate(boolean conflate)
If set, a socket shall keep only one message in its inbound/outbound queue,
this message being the last message received/the last message to be sent.
|
boolean |
setConnectRid(byte[] rid)
The ZMQ_CONNECT_RID option sets the peer id of the next host connected via the connect() call,
and immediately readies that connection for data transfer with the named id.
|
boolean |
setConnectRid(String rid)
The ZMQ_CONNECT_RID option sets the peer id of the next host connected via the connect() call,
and immediately readies that connection for data transfer with the named id.
|
boolean |
setCurvePublicKey(byte[] key)
Sets the socket's long term public key.
|
boolean |
setCurveSecretKey(byte[] key)
Sets the socket's long term secret key.
|
boolean |
setCurveServer(boolean server)
Defines whether the socket will act as server for CURVE security, see zmq_curve(7).
|
boolean |
setCurveServerKey(byte[] key)
Sets the socket's long term server key.
|
boolean |
setDecoder(Class<? extends IDecoder> cls)
Deprecated.
|
boolean |
setDelayAttachOnConnect(boolean value)
Deprecated.
use
setImmediate(boolean) instead (warning, the boolean is inverted) |
boolean |
setEncoder(Class<? extends IEncoder> cls)
Deprecated.
|
boolean |
setHandshakeIvl(int maxHandshakeIvl)
The ZMQ_HANDSHAKE_IVL option shall set the maximum handshake interval for the specified socket.
|
boolean |
setHWM(int hwm)
The 'ZMQ_HWM' option shall set the high water mark for the specified 'socket'.
|
boolean |
setHWM(long hwm)
Deprecated.
this option uses integer range, use
setHWM(int) instead |
boolean |
setIdentity(byte[] identity)
The 'ZMQ_IDENTITY' option shall set the identity of the specified 'socket'.
|
boolean |
setImmediate(boolean value)
Accept messages immediately or only when connections are made
By default queues will fill on outgoing connections even if the connection has not completed.
|
boolean |
setIPv4Only(boolean v4only)
Deprecated.
use
setIPv6(boolean) instead (inverted logic: ipv4 = true <==> ipv6 = false) |
boolean |
setIPv6(boolean v6)
Set the IPv6 option for the socket.
|
boolean |
setLinger(int value)
The ZMQ_LINGER option shall set the linger period for the specified socket.
|
boolean |
setLinger(long value)
Deprecated.
the linger option has only integer range, use
setLinger(int) instead |
boolean |
setMaxMsgSize(long value)
Limits the size of the inbound message.
|
boolean |
setMsgAllocationHeapThreshold(int threshold)
Sets the limit threshold where messages of a given size will be allocated using Direct ByteBuffer.
|
boolean |
setMsgAllocator(MsgAllocator allocator)
Sets a custom message allocator.
|
boolean |
setMulticastHops(long value)
Sets the time-to-live field in every multicast packet sent from this socket.
|
boolean |
setMulticastLoop(boolean multicastLoop)
Deprecated.
|
boolean |
setPlainPassword(byte[] password)
Sets the password for outgoing connections over TCP or IPC.
|
boolean |
setPlainPassword(String password)
Sets the password for outgoing connections over TCP or IPC.
|
boolean |
setPlainServer(boolean server)
Defines whether the socket will act as server for PLAIN security, see zmq_plain(7).
|
boolean |
setPlainUsername(byte[] username)
Sets the username for outgoing connections over TCP or IPC.
|
boolean |
setPlainUsername(String username)
Sets the username for outgoing connections over TCP or IPC.
|
boolean |
setProbeRouter(boolean probe)
When set to true, the socket will automatically send
an empty message when a new connection is made or accepted.
|
boolean |
setRate(long value)
The 'ZMQ_RATE' option shall set the maximum send or receive data rate for multicast
transports such as in the man page of zmq_pgm[7] using the specified 'socket'.
|
boolean |
setRcvHWM(int value)
The ZMQ_RCVHWM option shall set the high water mark for inbound messages on the specified socket.
|
boolean |
setRcvHWM(long value)
Deprecated.
this option uses integer range, use
setRcvHWM(int) instead |
boolean |
setReceiveBufferSize(int value)
The 'ZMQ_RCVBUF' option shall set the underlying kernel receive buffer size for the
'socket' to the specified size in bytes.
|
boolean |
setReceiveBufferSize(long value)
Deprecated.
this option uses integer range, use
setReceiveBufferSize(int) instead |
boolean |
setReceiveTimeOut(int value)
Sets the timeout for receive operation on the socket.
|
boolean |
setReconnectIVL(int value)
The ZMQ_RECONNECT_IVL option shall set the initial reconnection interval for the specified socket.
|
boolean |
setReconnectIVL(long value)
Deprecated.
reconnect interval option uses integer range, use
setReconnectIVL(int) instead |
boolean |
setReconnectIVLMax(int value)
The ZMQ_RECONNECT_IVL_MAX option shall set the maximum reconnection interval for the specified socket.
|
boolean |
setReconnectIVLMax(long value)
Deprecated.
this option uses integer range, use
setReconnectIVLMax(int) instead |
boolean |
setRecoveryInterval(long value)
The 'ZMQ_RECOVERY_IVL' option shall set the recovery interval for multicast transports
using the specified 'socket'.
|
boolean |
setReqCorrelate(boolean correlate)
The default behavior of REQ sockets is to rely on the ordering of messages
to match requests and responses and that is usually sufficient.
|
boolean |
setReqRelaxed(boolean relaxed)
By default, a REQ socket does not allow initiating a new request with zmq_send(3)
until the reply to the previous one has been received.
|
boolean |
setRouterHandover(boolean handover)
If two clients use the same identity when connecting to a ROUTER,
the results shall depend on the ZMQ_ROUTER_HANDOVER option setting.
|
boolean |
setRouterMandatory(boolean mandatory)
Sets the ROUTER socket behavior when an unroutable message is encountered.
|
boolean |
setRouterRaw(boolean raw)
Sets the raw mode on the ROUTER, when set to true.
|
boolean |
setSendBufferSize(int value)
The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size for the
'socket' to the specified size in bytes.
|
boolean |
setSendBufferSize(long value)
Deprecated.
this option uses integer range, use
setSendBufferSize(int) instead |
boolean |
setSendTimeOut(int value)
Sets the timeout for send operation on the socket.
|
boolean |
setSndHWM(int value)
The ZMQ_SNDHWM option shall set the high water mark for outbound messages on the specified socket.
|
boolean |
setSndHWM(long value)
Deprecated.
this option uses integer range, use
setSndHWM(int) instead |
boolean |
setSocksProxy(byte[] proxy)
Sets the SOCKS5 proxy address that shall be used by the socket for the TCP connection(s).
|
boolean |
setSocksProxy(String proxy)
Sets the SOCKS5 proxy address that shall be used by the socket for the TCP connection(s).
|
boolean |
setSwap(long value)
Deprecated.
|
boolean |
setTCPKeepAlive(int optVal)
Override SO_KEEPALIVE socket option (where supported by OS) to enable keep-alive packets for a socket
connection.
|
boolean |
setTCPKeepAlive(long value)
Deprecated.
|
boolean |
setTCPKeepAliveCount(long value)
Override TCP_KEEPCNT socket option (where supported by OS).
|
boolean |
setTCPKeepAliveIdle(long value)
Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS) socket option (where supported by OS).
|
boolean |
setTCPKeepAliveInterval(long value)
Override TCP_KEEPINTVL socket option (where supported by OS).
|
boolean |
setTos(int value)
Sets the ToS fields (Differentiated services (DS)
and Explicit Congestion Notification (ECN) field of the IP header.
|
boolean |
setXpubNoDrop(boolean noDrop)
Sets the XPUB socket behaviour to return error EAGAIN if SENDHWM is reached and the message could not be send.
|
boolean |
setXpubVerbose(boolean verbose)
Sets the XPUB socket behavior on new subscriptions and unsubscriptions.
|
boolean |
setZapDomain(byte[] domain)
Sets the domain for ZAP (ZMQ RFC 27) authentication.
|
boolean |
setZAPDomain(byte[] domain)
Sets the domain for ZAP (ZMQ RFC 27) authentication.
|
boolean |
setZapDomain(String domain)
Sets the domain for ZAP (ZMQ RFC 27) authentication.
|
boolean |
setZAPDomain(String domain)
Sets the domain for ZAP (ZMQ RFC 27) authentication.
|
boolean |
subscribe(byte[] topic)
The 'ZMQ_SUBSCRIBE' option shall establish a new message filter on a 'ZMQ_SUB' socket.
|
boolean |
subscribe(String topic)
The 'ZMQ_SUBSCRIBE' option shall establish a new message filter on a 'ZMQ_SUB' socket.
|
String |
toString() |
boolean |
unbind(String addr)
Stop accepting connections on a socket.
|
boolean |
unsubscribe(byte[] topic)
The 'ZMQ_UNSUBSCRIBE' option shall remove an existing message filter on a 'ZMQ_SUB'
socket.
|
boolean |
unsubscribe(String topic)
The 'ZMQ_UNSUBSCRIBE' option shall remove an existing message filter on a 'ZMQ_SUB'
socket.
|
protected ZMQ.Socket(ZMQ.Context context, int type)
context - a 0MQ context previously created.type - the socket type.protected ZMQ.Socket(SocketBase base)
public SocketBase base()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic int getType()
public int getLinger()
setLinger(int)@Deprecated public boolean setLinger(long value)
setLinger(int) insteadvalue - the linger period in milliseconds.getLinger()public boolean setLinger(int value)
value - the linger period in milliseconds.getLinger()public int getReconnectIVL()
setReconnectIVL(int)@Deprecated public boolean setReconnectIVL(long value)
setReconnectIVL(int) insteadgetReconnectIVL()public boolean setReconnectIVL(int value)
getReconnectIVL()public int getBacklog()
setBacklog(int)@Deprecated public boolean setBacklog(long value)
setBacklog(int) instead.value - the maximum length of the queue of outstanding peer connections.getBacklog()public boolean setBacklog(int value)
value - the maximum length of the queue of outstanding peer connections.getBacklog()public int getHandshakeIvl()
setHandshakeIvl(int)public boolean setHandshakeIvl(int maxHandshakeIvl)
maxHandshakeIvl - the maximum handshake intervalgetHandshakeIvl()public int getTos()
setTos(int)public boolean setTos(int value)
getTos()public int getReconnectIVLMax()
setReconnectIVLMax(int)@Deprecated public boolean setReconnectIVLMax(long value)
setReconnectIVLMax(int) insteadgetReconnectIVLMax()public boolean setReconnectIVLMax(int value)
getReconnectIVLMax()public long getMaxMsgSize()
setMaxMsgSize(long)public boolean setMaxMsgSize(long value)
getMaxMsgSize()public int getSndHWM()
setSndHWM(int)@Deprecated public boolean setSndHWM(long value)
setSndHWM(int) insteadgetSndHWM()public boolean setSndHWM(int value)
value - getSndHWM()public int getRcvHWM()
setRcvHWM(int)@Deprecated public boolean setRcvHWM(long value)
setRcvHWM(int) insteadgetRcvHWM()public boolean setRcvHWM(int value)
value - getRcvHWM()@Deprecated public int getHWM()
setHWM(int)@Deprecated public boolean setHWM(long hwm)
setHWM(int) insteadhwm - the number of messages to queue.public boolean setHWM(int hwm)
hwm - the number of messages to queue.@Deprecated public long getSwap()
setSwap(long)public boolean setConflate(boolean conflate)
conflate - true to keep only one message, false for standard behaviour.isConflate()public boolean isConflate()
setConflate(boolean)public boolean getConflate()
setConflate(boolean)@Deprecated public boolean setSwap(long value)
value - The value of 'ZMQ_SWAP' defines the maximum size of the swap space in bytes.public long getAffinity()
setAffinity(long)public boolean setAffinity(long value)
value - the io_thread affinity.public byte[] getIdentity()
setIdentity(byte[])public boolean setIdentity(byte[] identity)
identity - public long getRate()
setRate(long)public boolean setRate(long value)
value - maximum send or receive data rate for multicast, default 100public long getRecoveryInterval()
setRecoveryInterval(long)public boolean setRecoveryInterval(long value)
value - recovery interval for multicast in milliseconds, default 10000getRecoveryInterval()public boolean setReqCorrelate(boolean correlate)
correlate - Whether to enable outgoing request ids.getReqCorrelate()@Deprecated public boolean getReqCorrelate()
setReqCorrelate(boolean)public boolean setReqRelaxed(boolean relaxed)
relaxed - getReqRelaxed()@Deprecated public boolean getReqRelaxed()
setReqRelaxed(boolean)@Deprecated public boolean hasMulticastLoop()
setMulticastLoop(boolean)@Deprecated public boolean setMulticastLoop(boolean multicastLoop)
multicastLoop - public long getMulticastHops()
setMulticastHops(long)public boolean setMulticastHops(long value)
value - time-to-live field in every multicast packet, default 1public int getReceiveTimeOut()
setReceiveTimeOut(int)public boolean setReceiveTimeOut(int value)
value - Timeout for receive operation in milliseconds. Default -1 (infinite)getReceiveTimeOut()public int getSendTimeOut()
setSendTimeOut(int)public boolean setSendTimeOut(int value)
value - Timeout for send operation in milliseconds. Default -1 (infinite)getSendTimeOut()@Deprecated public boolean setTCPKeepAlive(long value)
value - The value of 'ZMQ_TCP_KEEPALIVE' to turn TCP keepalives on (1) or off (0).@Deprecated public long getTCPKeepAliveSetting()
setTCPKeepAlive(long)public boolean setTCPKeepAliveCount(long value)
value - The value of 'ZMQ_TCP_KEEPALIVE_CNT' defines the number of keepalives before death.public long getTCPKeepAliveCount()
setTCPKeepAliveCount(long)public boolean setTCPKeepAliveInterval(long value)
value - The value of 'ZMQ_TCP_KEEPALIVE_INTVL' defines the interval between keepalives. Unit is OS
dependent.public long getTCPKeepAliveInterval()
setTCPKeepAliveInterval(long)public boolean setTCPKeepAliveIdle(long value)
value - The value of 'ZMQ_TCP_KEEPALIVE_IDLE' defines the interval between the last data packet sent
over the socket and the first keepalive probe. Unit is OS dependent.public long getTCPKeepAliveIdle()
setTCPKeepAliveIdle(long)public int getSendBufferSize()
setSendBufferSize(int)@Deprecated public boolean setSendBufferSize(long value)
setSendBufferSize(int) insteadvalue - underlying kernel transmit buffer size for the 'socket' in bytes
A value of zero means leave the OS default unchanged.getSendBufferSize()public boolean setSendBufferSize(int value)
value - underlying kernel transmit buffer size for the 'socket' in bytes
A value of zero means leave the OS default unchanged.getSendBufferSize()public int getReceiveBufferSize()
setReceiveBufferSize(int)@Deprecated public boolean setReceiveBufferSize(long value)
setReceiveBufferSize(int) insteadvalue - Underlying kernel receive buffer size for the 'socket' in bytes.
A value of zero means leave the OS default unchanged.getReceiveBufferSize()public boolean setReceiveBufferSize(int value)
value - Underlying kernel receive buffer size for the 'socket' in bytes.
A value of zero means leave the OS default unchanged.getReceiveBufferSize()public boolean hasReceiveMore()
public SelectableChannel getFD()
public int getEvents()
public boolean subscribe(byte[] topic)
topic - public boolean subscribe(String topic)
topic - public boolean unsubscribe(byte[] topic)
topic - public boolean unsubscribe(String topic)
topic - @Deprecated public boolean setEncoder(Class<? extends IEncoder> cls)
cls - @Deprecated public boolean setDecoder(Class<? extends IDecoder> cls)
cls - public boolean setMsgAllocationHeapThreshold(int threshold)
threshold - the threshold to set for the size limit of messages. 0 or negative to disable this system.public int getMsgAllocationHeapThreshold()
public boolean setMsgAllocator(MsgAllocator allocator)
allocator - the custom allocator.public boolean setConnectRid(String rid)
rid - the peer id of the next host.public boolean setConnectRid(byte[] rid)
rid - the peer id of the next host.public boolean setRouterRaw(boolean raw)
raw - true to set the raw mode on the ROUTER.public boolean setProbeRouter(boolean probe)
probe - true to send automatically an empty message when a new connection is made or accepted.public boolean setRouterMandatory(boolean mandatory)
mandatory - A value of false is the default and discards the message silently when it cannot be routed.
A value of true returns an EHOSTUNREACH error code if the message cannot be routed.public boolean setRouterHandover(boolean handover)
handover - A value of false, (default) the ROUTER socket shall reject clients trying to connect with an already-used identity
A value of true, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing onepublic boolean setXpubVerbose(boolean verbose)
verbose - A value of false is the default and passes only new subscription messages to upstream.
A value of true passes all subscription messages upstream.public boolean setXpubNoDrop(boolean noDrop)
noDrop - @Deprecated public boolean getIPv4Only()
isIPv6() instead (inverted logic: ipv4 = true <==> ipv6 = false)(boolean)public boolean isIPv6()
(boolean)public boolean getIPv6()
(boolean)@Deprecated public boolean setIPv4Only(boolean v4only)
setIPv6(boolean) instead (inverted logic: ipv4 = true <==> ipv6 = false)v4only - A value of true will use IPv4 sockets, while the value of false will use IPv6 socketspublic boolean setIPv6(boolean v6)
v6 - A value of true will use IPv6 sockets, while the value of false will use IPv4 socketsisIPv6()public int getTCPKeepAlive()
setTCPKeepAlive(int)public boolean setTCPKeepAlive(int optVal)
optVal - The value of 'ZMQ_TCP_KEEPALIVE' to turn TCP keepalives on (1) or off (0).@Deprecated public boolean getDelayAttachOnConnect()
setImmediate(boolean) instead (inverted logic: immediate = true <==> delay attach on connect = false)setDelayAttachOnConnect(boolean)@Deprecated public boolean setDelayAttachOnConnect(boolean value)
setImmediate(boolean) instead (warning, the boolean is inverted)value - The value of 'ZMQ_DELAY_ATTACH_ON_CONNECT'. Default false.public boolean isImmediate()
setImmediate(boolean)public boolean getImmediate()
setImmediate(boolean)public boolean setImmediate(boolean value)
value - The value of 'ZMQ_IMMEDIATE'. Default true.isImmediate()public boolean setSocksProxy(String proxy)
proxy - getSocksProxy()public boolean setSocksProxy(byte[] proxy)
proxy - getSocksProxy()public String getSocksProxy()
setSocksProxy(byte[])public String getLastEndpoint()
public boolean setZapDomain(String domain)
domain - the domain of ZAP authenticationgetZapDomain()public boolean setZapDomain(byte[] domain)
domain - the domain of ZAP authenticationgetZapDomain()public String getZapDomain()
setZapDomain(String)public boolean setZAPDomain(String domain)
domain - the domain of ZAP authenticationgetZapDomain()public boolean setZAPDomain(byte[] domain)
domain - the domain of ZAP authenticationgetZapDomain()public String getZAPDomain()
setZapDomain(String)@Deprecated public boolean setAsServerPlain(boolean server)
setPlainServer(boolean) insteadserver - true if the role of the socket should be server for PLAIN security.isAsServerPlain()public boolean setPlainServer(boolean server)
server - true if the role of the socket should be server for PLAIN security.isAsServerPlain()@Deprecated public boolean isAsServerPlain()
getPlainServer() insteadsetAsServerPlain(boolean)@Deprecated public boolean getAsServerPlain()
getPlainServer() insteadsetAsServerPlain(boolean)public boolean getPlainServer()
setAsServerPlain(boolean)public boolean setPlainUsername(String username)
username - the username to set.public boolean setPlainPassword(String password)
password - the password to set.public boolean setPlainUsername(byte[] username)
username - the username to set.public boolean setPlainPassword(byte[] password)
password - the password to set.public String getPlainUsername()
public String getPlainPassword()
@Deprecated public boolean setAsServerCurve(boolean server)
setCurveServer(boolean) insteadserver - true if the role of the socket should be server for CURVE mechanismisAsServerCurve()public boolean setCurveServer(boolean server)
server - true if the role of the socket should be server for CURVE mechanismisAsServerCurve()@Deprecated public boolean isAsServerCurve()
getCurveServer() insteadsetAsServerCurve(boolean)public boolean getCurveServer()
setAsServerCurve(boolean)@Deprecated public boolean getAsServerCurve()
getCurveServer() insteadsetAsServerCurve(boolean)public boolean setCurvePublicKey(byte[] key)
Curve.keypair() or Curve.keypairZ85().key - the curve public keygetCurvePublicKey()public boolean setCurveServerKey(byte[] key)
Curve.keypair() or Curve.keypairZ85().key - the curve server keygetCurveServerKey()public boolean setCurveSecretKey(byte[] key)
Curve.keypair() or Curve.keypairZ85().key - the curve secret keygetCurveSecretKey()public byte[] getCurvePublicKey()
setCurvePublicKey(byte[])public byte[] getCurveServerKey()
setCurveServerKey(byte[])public byte[] getCurveSecretKey()
setCurveSecretKey(byte[])public ZMQ.Socket.Mechanism getMechanism()
public boolean bind(String addr)
addr - the endpoint to bind to.public int bindToRandomPort(String addr)
addr - the endpoint to bind to.public int bindToRandomPort(String addr, int min, int max)
addr - the endpoint to bind to.min - The minimum port in the range of ports to try.max - The maximum port in the range of ports to try.public boolean connect(String addr)
addr - the endpoint to connect to.public boolean disconnect(String addr)
addr - the endpoint to disconnect from.public boolean unbind(String addr)
addr - the endpoint to unbind from.public boolean send(String data)
public boolean sendMore(String data)
public boolean send(String data, int flags)
public boolean send(byte[] data)
public boolean sendMore(byte[] data)
public boolean send(byte[] data,
int flags)
public boolean send(byte[] data,
int off,
int length,
int flags)
public int sendByteBuffer(ByteBuffer data, int flags)
data - ByteBuffer payloadflags - the flags to apply to the send operationpublic byte[] recv()
public byte[] recv(int flags)
flags - the flags to apply to the receive operation.public int recv(byte[] buffer,
int offset,
int len,
int flags)
buffer - byte[] to copy zmq message payload in to.offset - offset in buffer to write datalen - max bytes to write to buffer.
If len is smaller than the incoming message size,
the message will be truncated.flags - the flags to apply to the receive operation.public int recvByteBuffer(ByteBuffer buffer, int flags)
buffer - the buffer to copy the zmq message payload intoflags - the flags to apply to the receive operationpublic String recvStr()
public String recvStr(int flags)
flags - the flags to apply to the receive operation.public boolean monitor(String addr, int events)
addr - the endpoint to receive events from. (must be inproc transport)events - the events of interest.ZMQExceptionpublic int errno()
Copyright © 2017. All rights reserved.