public class SocketBuilder extends Object implements Bindable, Connectable
Modifier and Type | Class and Description |
---|---|
class |
SocketBuilder.SocketSpec |
Modifier and Type | Field and Description |
---|---|
protected ManagedContext |
context |
protected SocketBuilder.SocketSpec |
socketSpec |
Constructor and Description |
---|
SocketBuilder(ManagedContext context,
SocketType socketType) |
Modifier and Type | Method and Description |
---|---|
Routable |
asRoutable()
Coerce the SocketBuilder to be Routable.
|
Subscribable |
asSubscribable()
Coerce the SocketBuilder to be Subscribable.
|
Socket |
bind(String url)
Bind to a url.
|
Socket |
bind(String url,
String... additionalUrls)
Bind to a url.
|
protected void |
bind(org.zeromq.ZMQ.Socket socket,
String url,
String[] additionalUrls) |
Socket |
connect(String url)
Connect to a url.
|
Socket |
connect(String url,
String... additionalUrls)
Connect to a url.
|
protected void |
connect(org.zeromq.ZMQ.Socket socket,
String url,
String[] additionalUrls) |
protected org.zeromq.ZMQ.Socket |
createBindableSocketWithStandardSettings() |
protected org.zeromq.ZMQ.Socket |
createConnectableSocketWithStandardSettings() |
byte[] |
getIdentity()
Return the identity of the socket
|
int |
getLinger()
Returns the linger period in millis
|
int |
getReceiveHighWaterMark()
Returns the receive high water mark.
|
int |
getSendHighWaterMark()
Get the send high watermark.
|
SocketBuilder.SocketSpec |
getSocketSpec() |
SocketType |
getSocketType()
Returns the underlying socket type
|
long |
getSwap()
Return the swap size in bytes
|
protected Socket |
newManagedSocket(org.zeromq.ZMQ.Socket socket) |
SocketBuilder |
withBackgroundable(Backgroundable backgroundable) |
SocketBuilder |
withIdentity(byte[] identity)
Set the socket identity of the specified socket.
|
SocketBuilder |
withLinger(int lingerMS)
Set the linger period for the specified socket.
|
SocketBuilder |
withLinger(long lingerMS)
Deprecated.
The linger option has only integer range, use
withLinger(int) instead. |
SocketBuilder |
withReceiveHighWatermark(int receiveHWM)
The RECVHWM option shall set the high water mark (HWM) for inbound messages on the specified socket.
|
SocketBuilder |
withReceiveHighWatermark(long receiveHWM)
Deprecated.
This option uses integer range, use
withReceiveHighWatermark(int) instead. |
SocketBuilder |
withReceiveTimeout(int receiveTimeout) |
SocketBuilder |
withSendHighWatermark(int sendHWM)
Set the send high watermark.
|
SocketBuilder |
withSendHighWatermark(long sendHWM)
Deprecated.
This option uses integer range, use
withSendHighWatermark(int) instead. |
SocketBuilder |
withSendTimeout(int sendTimeout) |
SocketBuilder |
withSwap(long swapSize)
The swap option shall set the disk offload (swap) size for the specified socket.
|
protected ManagedContext context
protected SocketBuilder.SocketSpec socketSpec
public SocketBuilder(ManagedContext context, SocketType socketType)
public SocketType getSocketType()
@Deprecated public SocketBuilder withLinger(long lingerMS)
withLinger(int)
instead.lingerMS
- the linger period in millispublic SocketBuilder withLinger(int lingerMS)
lingerMS
- the linger period in millispublic int getLinger()
public SocketBuilder withIdentity(byte[] identity)
identity
- the identitypublic byte[] getIdentity()
public SocketBuilder withSwap(long swapSize)
swapSize
- swap in bytespublic long getSwap()
@Deprecated public SocketBuilder withSendHighWatermark(long sendHWM)
withSendHighWatermark(int)
instead.sendHWM
- The send high watermarkpublic SocketBuilder withSendHighWatermark(int sendHWM)
sendHWM
- The send high watermarkpublic int getSendHighWaterMark()
@Deprecated public SocketBuilder withReceiveHighWatermark(long receiveHWM)
withReceiveHighWatermark(int)
instead.receiveHWM
- recv high water markpublic SocketBuilder withReceiveHighWatermark(int receiveHWM)
receiveHWM
- recv high water markpublic int getReceiveHighWaterMark()
public SocketBuilder.SocketSpec getSocketSpec()
public SocketBuilder withReceiveTimeout(int receiveTimeout)
public SocketBuilder withSendTimeout(int sendTimeout)
public SocketBuilder withBackgroundable(Backgroundable backgroundable)
public Socket connect(String url)
connect
in interface Connectable
url
- the url to connect topublic Socket connect(String url, String... additionalUrls)
Connectable
connect
in interface Connectable
url
- the url to connect toadditionalUrls
- additional urls to connect toprotected org.zeromq.ZMQ.Socket createConnectableSocketWithStandardSettings()
public Socket bind(String url, String... additionalUrls)
Bindable
protected org.zeromq.ZMQ.Socket createBindableSocketWithStandardSettings()
protected Socket newManagedSocket(org.zeromq.ZMQ.Socket socket)
public Subscribable asSubscribable()
public Routable asRoutable()
Copyright © 2019. All rights reserved.