java.lang.Object
swim.io.TcpSettings
- All Implemented Interfaces:
Debug
TCP configuration parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
protected final boolean
protected final int
protected final int
protected final int
protected final int
-
Constructor Summary
ConstructorsConstructorDescriptionTcpSettings
(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if theseTcpSettings
can possibly equal someother
object.void
Configures thesocket
with theseTcpSettings
.protected TcpSettings
copy
(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) Returns a newTcpSettings
instance with the given options.<T> Output<T>
Writes a developer readable, debug-formatted string representation of this object tooutput
.boolean
static Form<TcpSettings>
form()
Returns the structuralForm
ofTcpSettings
.int
hashCode()
final boolean
Returnstrue
if TCP should be configured with theSO_KEEPALIVE
socket option to send keepalive probes to prevent idle connections from timing out.keepAlive
(boolean keepAlive) Returns a copy of theseTcpSettings
configured with the givenkeepAlive
value for theSO_KEEPALIVE
socket option.final boolean
noDelay()
Returnstrue
if TCP should be configured with theTCP_NODELAY
socket option to disable Nagle's algorithm.noDelay
(boolean noDelay) Returns a copy of theseTcpSettings
configured with the givennoDelay
value for theTCP_NODELAY
socket option.final int
Returns the size in bytes of the per-socket userspace buffers into which data is received.readBufferSize
(int readBufferSize) Returns a copy of theseTcpSettings
configured with the givenreadBufferSize
for per-socket userspace read buffers.final int
Returns the value of theSO_RCVBUF
socket option with which TCP should be configured to control the size of receive buffers.receiveBufferSize
(int receiveBufferSize) Returns a copy of theseTcpSettings
configured with the givenreceiveBufferSize
value for theSO_RCVBUF
socket option.final int
Returns the value of theSO_SNDBUF
socket option with which TCP should be configured to control the size of send buffers.sendBufferSize
(int sendBufferSize) Returns a copy of theseTcpSettings
configured with the givensendBufferSize
value for theSO_SNDBUF
socket option.static TcpSettings
standard()
Returns the defaultTcpSettings
instance.toString()
toValue()
Returns a structuralValue
representing theseTcpSettings
.final int
Returns the size in bytes of the per-socket userspace buffers from which data is sent.writeBufferSize
(int writeBufferSize) Returns a copy of theseTcpSettings
configured with the givenwriteBufferSize
for per-socket userspace write buffers.
-
Field Details
-
keepAlive
protected final boolean keepAlive -
noDelay
protected final boolean noDelay -
receiveBufferSize
protected final int receiveBufferSize -
sendBufferSize
protected final int sendBufferSize -
readBufferSize
protected final int readBufferSize -
writeBufferSize
protected final int writeBufferSize
-
-
Constructor Details
-
TcpSettings
public TcpSettings(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize)
-
-
Method Details
-
keepAlive
public final boolean keepAlive()Returnstrue
if TCP should be configured with theSO_KEEPALIVE
socket option to send keepalive probes to prevent idle connections from timing out. -
keepAlive
Returns a copy of theseTcpSettings
configured with the givenkeepAlive
value for theSO_KEEPALIVE
socket option. -
noDelay
public final boolean noDelay()Returnstrue
if TCP should be configured with theTCP_NODELAY
socket option to disable Nagle's algorithm. -
noDelay
Returns a copy of theseTcpSettings
configured with the givennoDelay
value for theTCP_NODELAY
socket option. -
receiveBufferSize
public final int receiveBufferSize()Returns the value of theSO_RCVBUF
socket option with which TCP should be configured to control the size of receive buffers. -
receiveBufferSize
Returns a copy of theseTcpSettings
configured with the givenreceiveBufferSize
value for theSO_RCVBUF
socket option. -
sendBufferSize
public final int sendBufferSize()Returns the value of theSO_SNDBUF
socket option with which TCP should be configured to control the size of send buffers. -
sendBufferSize
Returns a copy of theseTcpSettings
configured with the givensendBufferSize
value for theSO_SNDBUF
socket option. -
readBufferSize
public final int readBufferSize()Returns the size in bytes of the per-socket userspace buffers into which data is received. -
readBufferSize
Returns a copy of theseTcpSettings
configured with the givenreadBufferSize
for per-socket userspace read buffers. -
writeBufferSize
public final int writeBufferSize()Returns the size in bytes of the per-socket userspace buffers from which data is sent. -
writeBufferSize
Returns a copy of theseTcpSettings
configured with the givenwriteBufferSize
for per-socket userspace write buffers. -
copy
protected TcpSettings copy(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) Returns a newTcpSettings
instance with the given options. Subclasses may override this method to ensure the proper class is instantiated when updating settings. -
configure
Configures thesocket
with theseTcpSettings
.- Throws:
SocketException
-
toValue
Returns a structuralValue
representing theseTcpSettings
. -
canEqual
Returnstrue
if theseTcpSettings
can possibly equal someother
object. -
equals
-
hashCode
public int hashCode() -
debug
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
. -
toString
-
standard
Returns the defaultTcpSettings
instance. -
form
Returns the structuralForm
ofTcpSettings
.
-