Code example for DatagramSocket

Methods: getReceiveBufferSize, setReceiveBufferSize

0
        assertTrue("Incorrect buffer size", ds.getSendBufferSize() >= 134);
    } 
 
    public void test_setReceiveBufferSizeI() throws Exception { 
        int portNumber = Support_PortManager.getNextPortForUDP();
        ds = new java.net.DatagramSocket(portNumber);
        ds.setReceiveBufferSize(130);
        assertTrue("Incorrect buffer size", ds.getReceiveBufferSize() >= 130);
    } 
 
    public void test_setSoTimeoutI() throws Exception { 
        DatagramSocket ds = new DatagramSocket();
        ds.setSoTimeout(100);
        assertTrue("Set incorrect timeout", ds.getSoTimeout() >= 100);
    } 
 
    public void test_ConstructorLjava_net_DatagramSocketImpl() { 
        class SimpleTestDatagramSocket extends DatagramSocket {
            public SimpleTestDatagramSocket(DatagramSocketImpl impl) {
                super(impl);
            }