|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dvb.net.DatagramSocketBufferControl
This class provides additional control over buffering for DatagramSocket
s.
Method Summary | |
static int |
getReceiveBufferSize(java.net.DatagramSocket d)
Get value of the SO_RCVBUF option for this socket, that is the buffer size used by the platform for input on the this Socket. |
static void |
setReceiveBufferSize(java.net.DatagramSocket d,
int size)
Sets the SO_RCVBUF option to the specified value for this DatagramSocket. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setReceiveBufferSize(java.net.DatagramSocket d, int size) throws java.net.SocketException
Increasing buffer size can increase the performance of network I/O for high-volume connection, while decreasing it can help reduce the backlog of incoming data. For UDP, this sets the buffer size for received packets.
Because SO_RCVBUF is a hint, applications that want to verify what size the buffers were set to should call getReceiveBufferSize. This method shall throw IllegalArgumentException - if size is 0 or is negative.
d
- The DatagramSocket for which to change the receive buffer
size.size
- The requested size of the receive buffer, in bytes.
java.net.SocketException
- - If there is an error when setting the
SO_RCVBUF option.public static int getReceiveBufferSize(java.net.DatagramSocket d) throws java.net.SocketException
d
- The DatagramSocket for which to query the receive buffer
size.
java.net.SocketException
- - If there is an error when querying the
SO_RCVBUF option.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |