|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dvb.net.DatagramSocketBufferControl
public class DatagramSocketBufferControl
This class provides additional control over buffering for DatagramSockets.
| Method Summary | |
|---|---|
static int |
getReceiveBufferSize(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(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(DatagramSocket d,
int size)
throws 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.
SocketException - - If there is an error when setting the
SO_RCVBUF option.
public static int getReceiveBufferSize(DatagramSocket d)
throws SocketException
d - The DatagramSocket for which to query the receive buffer
size.
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 | |||||||||