/** * @return Full version number of the ZMQ library used for comparing versions. */ public static int getFullVersion() { return version_full(); }
/** * @see #setMaxMsgSize(long) * * @return the maxMsgSize. * @since 3.0.0 */ public long getMaxMsgSize() { if (ZMQ.version_full() < ZMQ.make_version(3, 0, 0)) return -1; return getLongSockopt(MAXMSGSIZE); }
/** * @see #setTCPKeepAlive(long) * * @return the keep alive setting. */ public long getTCPKeepAliveSetting() { if (ZMQ.version_full() < ZMQ.make_version(3, 2, 0)) return -1; return getLongSockopt(KEEPALIVE); }
/** * @see #setTCPKeepAliveCount(long) * * @return the keep alive count. */ public long getTCPKeepAliveCount() { if (ZMQ.version_full() < ZMQ.make_version(3, 2, 0)) return -1; return getLongSockopt(KEEPALIVECNT); }
/** * @see #setPlainPassword(byte[]) * * @return null terminated byte array in server charset */ public byte[] getPlainPassword() { if (ZMQ.version_full() >= ZMQ.make_version(4, 0, 0)) { return getBytesSockopt(PLAIN_PASSWORD); } return null; }
/** * @since 3.0.0 */ public void setRcvHWM(long rcvHWM) { if (ZMQ.version_full() < ZMQ.make_version(3, 0, 0)) return; setLongSockopt(RCVHWM, rcvHWM); }
/** * Sets the password used for the PLAIN security mechanism. * @see <a href="http://rfc.zeromq.org/spec:24">PLAIN RFC</a> * @param password null terminated string in server charset * @since 4.0.0 */ public void setPlainPassword(byte[] password) { if (ZMQ.version_full() >= ZMQ.make_version(4, 0, 0)) { setBytesSockopt(PLAIN_PASSWORD, password); } }
/** * @see #setReconnectIVL(long) * * @return the reconnectIVL. * @since 3.0.0 */ public long getReconnectIVL() { if (ZMQ.version_full() < ZMQ.make_version(2, 1, 10)) return -1; return getLongSockopt(RECONNECT_IVL); }
/** * @see #setReconnectIVLMax(long) * * @return the reconnectIVLMax. * @since 3.0.0 */ public long getReconnectIVLMax() { if (ZMQ.version_full() < ZMQ.make_version(2, 1, 10)) return -1; return getLongSockopt(RECONNECT_IVL_MAX); }
/** * @see #setSndHWM(long) * * @return the SndHWM. * @since 3.0.0 */ public long getSndHWM() { if (ZMQ.version_full() < ZMQ.make_version(3, 0, 0)) return -1; return getLongSockopt(SNDHWM); }
/** * @see #setPlainUsername(byte[]) * * @return null terminated byte array in server charset */ public byte[] getPlainUsername() { if (ZMQ.version_full() >= ZMQ.make_version(4, 0, 0)) { return getBytesSockopt(PLAIN_USERNAME); } return null; }
/** * The 'ZMQ_EVENTS' option shall retrieve event flags for the specified socket. If a message can be read from * the socket ZMQ_POLLIN flag is set. If message can be written to the socket ZMQ_POLLOUT flag is set. * * @return the mask of outstanding events. * @since 2.1.0 */ public long getEvents() { if (ZMQ.version_full() < ZMQ.make_version(2, 1, 0)) return -1; return getLongSockopt(EVENTS); }
/** * @since 3.0.0 */ public void setSndHWM(long sndHWM) { if (ZMQ.version_full() < ZMQ.make_version(3, 0, 0)) return; setLongSockopt(SNDHWM, sndHWM); }
public void setGSSAPIPrincipal(byte[] principal) { if(ZMQ.version_full() >= ZMQ.make_version(4, 1, 0)) { setBytesSockopt(GSSAPI_PRINCIPAL, principal); } }
public void setGSSAPIPlainText(boolean isPlaintext) { if(ZMQ.version_full() >= ZMQ.makeVersion(4, 1, 0)) { setLongSockopt(GSSAPI_PLAINTEXT, isPlaintext ? 1L : 0L); } }
/** * @since 3.0.0 */ public void setBacklog(long backlog) { if (ZMQ.version_full() < ZMQ.make_version(3, 0, 0)) return; setLongSockopt(BACKLOG, backlog); }
/** * Get the Swap. The 'ZMQ_SWAP' option shall set the disk offload (swap) size for the specified 'socket'. A * socket which has 'ZMQ_SWAP' set to a non-zero value may exceed its high water mark; in this case outstanding * messages shall be offloaded to storage on disk rather than held in memory. * * @param swap The value of 'ZMQ_SWAP' defines the maximum size of the swap space in bytes. */ public void setSwap(long swap) { if (ZMQ.version_full() >= ZMQ.make_version(3, 0, 0)) return; setLongSockopt(SWAP, swap); }
/** * Override SO_KEEPALIVE socket option (where supported by OS) to enable keep-alive packets for a socket * connection. Possible values are -1, 0, 1. The default value -1 will skip all overrides and do the OS default. * * @param optVal The value of 'ZMQ_TCP_KEEPALIVE' to turn TCP keepalives on (1) or off (0). */ public void setTCPKeepAlive(long optVal) { if (ZMQ.version_full() >= ZMQ.make_version(3, 2, 0)) setLongSockopt(KEEPALIVE, optVal); }
/** * Override TCP_KEEPINTVL socket option (where supported by OS). The default value -1 will skip all overrides * and do the OS default. * * @param optVal The value of 'ZMQ_TCP_KEEPALIVE_INTVL' defines the interval between keepalives. Unit is OS * dependant. */ public void setTCPKeepAliveInterval(long optVal) { if (ZMQ.version_full() >= ZMQ.make_version(3, 2, 0)) setLongSockopt(KEEPALIVEINTVL, optVal); }
public void setGSSAPIServer(boolean isServer) { if(ZMQ.version_full() >= ZMQ.makeVersion(4, 1, 0)) { setLongSockopt(GSSAPI_SERVER, isServer ? 1L : 0L); } }