DatagramSocket GetSendBufferSize() Example
Get value of the SO_SNDBUF option for this DatagramSocket
DatagramSocketclass GetSendBufferSize() method example. This example shows you how to use GetSendBufferSize() method.This method Get value of the SO_SNDBUF option for this DatagramSocket, that is the buffer size used by the platform for output on this DatagramSocket.
Here is the code:-
/**
* @Program that Returns the value of the SO_SNDBUF option for this DatagramSocket
* GetSendBufferSize.java
* Author:-RoseIndia Team
* Date:-20-jun-2008
*/
import java.net.*;
public class GetSendBufferSize {
public static void main(String[] args) throws Exception {
DatagramSocket ds = new DatagramSocket();
ds.connect(new InetSocketAddress(9090));
System.out.println("SNDBUF option for this DatagramSocket is: " + ds.getSendBufferSize());
}
} |
Output of the program:-
| SNDBUF option for this DatagramSocket is: 55296 |
|