java.lang.Object
swim.io.TcpSettings
- All Implemented Interfaces:
Debug
TCP configuration parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final intprotected final intprotected final intprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionTcpSettings(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif theseTcpSettingscan possibly equal someotherobject.voidConfigures thesocketwith theseTcpSettings.protected TcpSettingscopy(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) Returns a newTcpSettingsinstance with the given options.<T> Output<T>Writes a developer readable, debug-formatted string representation of this object tooutput.booleanstatic Form<TcpSettings>form()Returns the structuralFormofTcpSettings.inthashCode()final booleanReturnstrueif TCP should be configured with theSO_KEEPALIVEsocket option to send keepalive probes to prevent idle connections from timing out.keepAlive(boolean keepAlive) Returns a copy of theseTcpSettingsconfigured with the givenkeepAlivevalue for theSO_KEEPALIVEsocket option.final booleannoDelay()Returnstrueif TCP should be configured with theTCP_NODELAYsocket option to disable Nagle's algorithm.noDelay(boolean noDelay) Returns a copy of theseTcpSettingsconfigured with the givennoDelayvalue for theTCP_NODELAYsocket option.final intReturns the size in bytes of the per-socket userspace buffers into which data is received.readBufferSize(int readBufferSize) Returns a copy of theseTcpSettingsconfigured with the givenreadBufferSizefor per-socket userspace read buffers.final intReturns the value of theSO_RCVBUFsocket option with which TCP should be configured to control the size of receive buffers.receiveBufferSize(int receiveBufferSize) Returns a copy of theseTcpSettingsconfigured with the givenreceiveBufferSizevalue for theSO_RCVBUFsocket option.final intReturns the value of theSO_SNDBUFsocket option with which TCP should be configured to control the size of send buffers.sendBufferSize(int sendBufferSize) Returns a copy of theseTcpSettingsconfigured with the givensendBufferSizevalue for theSO_SNDBUFsocket option.static TcpSettingsstandard()Returns the defaultTcpSettingsinstance.toString()toValue()Returns a structuralValuerepresenting theseTcpSettings.final intReturns the size in bytes of the per-socket userspace buffers from which data is sent.writeBufferSize(int writeBufferSize) Returns a copy of theseTcpSettingsconfigured with the givenwriteBufferSizefor 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()Returnstrueif TCP should be configured with theSO_KEEPALIVEsocket option to send keepalive probes to prevent idle connections from timing out. -
keepAlive
Returns a copy of theseTcpSettingsconfigured with the givenkeepAlivevalue for theSO_KEEPALIVEsocket option. -
noDelay
public final boolean noDelay()Returnstrueif TCP should be configured with theTCP_NODELAYsocket option to disable Nagle's algorithm. -
noDelay
Returns a copy of theseTcpSettingsconfigured with the givennoDelayvalue for theTCP_NODELAYsocket option. -
receiveBufferSize
public final int receiveBufferSize()Returns the value of theSO_RCVBUFsocket option with which TCP should be configured to control the size of receive buffers. -
receiveBufferSize
Returns a copy of theseTcpSettingsconfigured with the givenreceiveBufferSizevalue for theSO_RCVBUFsocket option. -
sendBufferSize
public final int sendBufferSize()Returns the value of theSO_SNDBUFsocket option with which TCP should be configured to control the size of send buffers. -
sendBufferSize
Returns a copy of theseTcpSettingsconfigured with the givensendBufferSizevalue for theSO_SNDBUFsocket 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 theseTcpSettingsconfigured with the givenreadBufferSizefor 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 theseTcpSettingsconfigured with the givenwriteBufferSizefor per-socket userspace write buffers. -
copy
protected TcpSettings copy(boolean keepAlive, boolean noDelay, int receiveBufferSize, int sendBufferSize, int readBufferSize, int writeBufferSize) Returns a newTcpSettingsinstance with the given options. Subclasses may override this method to ensure the proper class is instantiated when updating settings. -
configure
Configures thesocketwith theseTcpSettings.- Throws:
SocketException
-
toValue
Returns a structuralValuerepresenting theseTcpSettings. -
canEqual
Returnstrueif theseTcpSettingscan possibly equal someotherobject. -
equals
-
hashCode
public int hashCode() -
debug
Description copied from interface:DebugWrites a developer readable, debug-formatted string representation of this object tooutput. -
toString
-
standard
Returns the defaultTcpSettingsinstance. -
form
Returns the structuralFormofTcpSettings.
-