Professional Documents
Culture Documents
Comparison:
KeepAlive() and ReceiveBufferSize( ):
KeepAlive method is to ensure the existence of a reference to an object that is at risk of being
prematurely reclaimed by the garbage collector
The ReceiveBufferSize property gets or sets the number of bytes that you are expecting to store in the
receive buffer for each read operation.
A send buffer size might delay the recognition of connection difficulties. Consider increasing the buffer
size if you are transferring large files, or you are using a high bandwidth, high latency connection (such
as a satellite broadband provider.)
ReceiveBufferSize( )
Comparison:
ReceiveBufferSize( ) and SendBufferSize( ):
The ReceiveBufferSize property gets or sets the number of bytes that you are expecting to store in the
receive buffer for each read operation.
A send buffer size might delay the recognition of connection difficulties. Consider increasing the buffer
size if you are transferring large files, or you are using a high bandwidth, high latency connection (such
as a satellite broadband provider.)
SoLinger return the setting of SO_LINGER option of socket or enables a socket to toggle the
SO_LINGER option.
SendBufferSize( ):
public int getSendBufferSize( )
Functionality
The getSendBufferSize() method returns the value of the SO_SNDBUF option of the specified
Socket.
Throws a SocketException - if there is an error in the underlying protocol, such as a TCP error.
Purpose
This method returns the buffer size (SO_SNDBUF) used by the platform for output on this
socket.
Comparison:
SendBufferSize( ) and SoLinger( ):
A send buffer size might delay the recognition of connection difficulties. Consider increasing the buffer
size if you are transferring large files, or you are using a high bandwidth, high latency connection (such
as a satellite broadband provider.)
SoLinger return the setting of SO_LINGER option of socket or enables a socket to toggle the
SO_LINGER option.
SoLinger( )
public int getSoLinger( )
Functionality
This method returns the setting if the SO_Linger option is set else it returns -1 if the option is
disabled.
Throws a SocketException - if there is an error in the underlying protocol, such as a TCP error.
Purpose
Returns the setting for SO_LINGER option.
SoTimeout( ):
public int getSoTimeout( )
Functionality
Used to enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
Throws an IOException - if an I/O error occurs.
Purpose
Retrieve the setting for the SO_TIMEOUT.
Comparison:
SoTimeout( ) and TcpNoDelay( ):
SoTimeout( ) method returns/set the value of SO_TIMEOUT option of the socket
TcpNoDelay( )
The ReceiveBufferSize property gets or sets the number of bytes that you are expecting to store in the
receive buffer for each read operation.