DatagramSocket getReceiveBufferSize - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DatagramSocket getReceiveBufferSize method.

This code example shows how to use the following methods:getReceiveBufferSize, getSendBufferSize, setReceiveBufferSize, setSendBufferSize
     * @param sendBufferSize Groesse des Sendepuffers in Byte 
     * @param receiveBufferSize Groesse des Empfangspuffers in Byte 
     */ 
     
    public UdpSocket(int port, int sendBufferSize, int receiveBufferSize) throws SocketException {
        socket = new DatagramSocket(port);
        try { 
        	socket.setReceiveBufferSize(receiveBufferSize);
        	socket.setSendBufferSize(sendBufferSize);
     
	    	System.out.println("Groesse des Empfangspuffers des Datagram-Sockets: " + socket.getReceiveBufferSize() + " Byte");
	    	System.out.println("Groesse des Sendepuffers des Datagram-Sockets: " + socket.getSendBufferSize() + " Byte");
	    } catch (SocketException e){
	    	log.debug("Socketfehler: " + e);
	    } 
    } 
 
    /** 
     * Empfangen einer Nachricht ueber UDP 
     *  
6
CodeRank
This code example shows how to use the following methods:getReceiveBufferSize, getSendBufferSize, setReceiveBufferSize, setSendBufferSize
	 *            Groesse des Empfangspuffers in Byte 
	 */ 
 
	public UdpSocket(int port, int sendBufferSize, int receiveBufferSize)
			throws SocketException { 
		socket = new DatagramSocket(port);
		try { 
			socket.setReceiveBufferSize(receiveBufferSize);
			socket.setSendBufferSize(sendBufferSize);
 
			System.out
					.println("Groesse des Empfangspuffers des Datagram-Sockets: "
							+ socket.getReceiveBufferSize() + " Byte");
			System.out
					.println("Groesse des Sendepuffers des Datagram-Sockets: "
							+ socket.getSendBufferSize() + " Byte");
		} catch (SocketException e) {
			log.debug("Socketfehler: " + e);
		} 
	} 
 
6
CodeRank
This code example shows how to use the following methods:getReceiveBufferSize, getSendBufferSize, setReceiveBufferSize, setSendBufferSize
	 *            Groesse des Empfangspuffers in Byte 
	 */ 
 
	public UnreliableUdpSocket(int port, int sendBufferSize, int receiveBufferSize)
			throws SocketException { 
		socket = new DatagramSocket(port);
		try { 
			socket.setReceiveBufferSize(receiveBufferSize);
			socket.setSendBufferSize(sendBufferSize);
 
			log.debug("Groesse des Empfangspuffers des Datagram-Sockets: "
					+ socket.getReceiveBufferSize() + " Byte");
			log.debug("Groesse des Sendepuffers des Datagram-Sockets: "
					+ socket.getSendBufferSize() + " Byte");
			 
		} catch (SocketException e) {
			log.debug("Socketfehler: " + e);
		} 
	} 
 
6
CodeRank
This code example shows how to use the following methods:close, getReceiveBufferSize, setReceiveBufferSize
        } 
    } 
 
    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);
 
        try { 
            ds.setReceiveBufferSize(0);
            fail("IllegalArgumentException was not thrown.");
        } catch(IllegalArgumentException iae) {
            //expected 
        } 
 
        try { 
            ds.setReceiveBufferSize(-1);
            fail("IllegalArgumentException was not thrown.");
        } catch(IllegalArgumentException iae) {

3
CodeRank
This code example shows how to use the following methods:getBroadcast, getInetAddress, getLocalAddress, getPort, getReceiveBufferSize
-1
CodeRank
This code example shows how to use the following methods:getReceiveBufferSize
        } 
    } 
 
    public int getReceiveBufferSize() { 
        try { 
            return socket.getReceiveBufferSize();
        } catch (SocketException e) {
            throw new ChannelException(e);
        } 
    } 
 
    public void setReceiveBufferSize(int receiveBufferSize) {
        try { 
            socket.setReceiveBufferSize(receiveBufferSize);
        } catch (SocketException e) {
            throw new ChannelException(e);
        } 
    } 
 
    public int getSendBufferSize() { 
4
CodeRank
getReceiveBufferSize Method Overview
Returns this socket's receive buffer size.
See Code Examples for other Java 8 DatagramSocket Methods: