Code example for DatagramSocket

Methods: getSendBufferSize, setSendBufferSize

0
        assertTrue("Incorrect buffer size", ds.getReceiveBufferSize() >= 130);
    } 
 
    public void test_getSendBufferSize() throws Exception { 
        int portNumber = Support_PortManager.getNextPortForUDP();
        ds = new java.net.DatagramSocket(portNumber);
        ds.setSendBufferSize(134);
        assertTrue("Incorrect buffer size", ds.getSendBufferSize() >= 134);
    } 
 
    public void test_getSoTimeout() throws Exception { 
        DatagramSocket ds = new DatagramSocket();
        ds.setSoTimeout(100);
        assertEquals("Returned incorrect timeout", 100, ds.getSoTimeout());
    } 
 
    public void test_receiveLjava_net_DatagramPacket() throws IOException { 
        // Test for method void 
        // java.net.DatagramSocket.receive(java.net.DatagramPacket) 
 
        receive_oversize_java_net_DatagramPacket();