DatagramSocket GetReceiveBufferSize() Example
Returns the value of the SO_RCVBUF option for this DatagramSocket
DatagramSocketclass GetReceiveBufferSize() method example. This example shows you how to use GetReceiveBufferSize() method.This method Returns the value of the SO_RCVBUF option for this DatagramSocket
Here is the code:-
/**
* @Program that Get value of the SO_RCVBUF option for this DatagramSocket
* GetReceiveBufferSize.java
* Author:-RoseIndia Team
* Date:-20-jun-2008
*/
import java.net.*;
public class GetReceiveBufferSize {
public static void main(String[] args) throws Exception {
DatagramSocket ds = new DatagramSocket();
ds.connect(new InetSocketAddress(9090));
//Get value of the SO_RCVBUF option for this DatagramSocket
int i = ds.getReceiveBufferSize();
System.out.println("RCVBUF for this DatagramSocket is: " + i);
}
} |
Output of the program:-
| RCVBUF for this DatagramSocket is: 55296 |
|