Class NioDatagramSessionConfig

    • Field Detail

      • channel

        private final java.nio.channels.DatagramChannel channel
        The associated channel
    • Constructor Detail

      • NioDatagramSessionConfig

        NioDatagramSessionConfig​(java.nio.channels.DatagramChannel channel)
        Creates a new instance of NioDatagramSessionConfig, associated with the given DatagramChannel.
        Parameters:
        channel - The associated DatagramChannel
    • Method Detail

      • getReceiveBufferSize

        public int getReceiveBufferSize()
        Get the Socket receive buffer size for this DatagramChannel.
        Returns:
        the DatagramChannel receive buffer size.
        Throws:
        RuntimeIoException - if the socket is closed or if we had a SocketException
        See Also:
        DatagramSocket.getReceiveBufferSize()
      • setReceiveBufferSize

        public void setReceiveBufferSize​(int receiveBufferSize)
        Set the Socket receive buffer size for this DatagramChannel.

        Note : The underlying Socket may not accept the new buffer's size. The user has to check that the new value has been set.
        Parameters:
        receiveBufferSize - the DatagramChannel receive buffer size.
        Throws:
        RuntimeIoException - if the socket is closed or if we had a SocketException
        See Also:
        DatagramSocket.setReceiveBufferSize(int)
      • isBroadcast

        public boolean isBroadcast()
        Tells if SO_BROADCAST is enabled.
        Returns:
        true if SO_BROADCAST is enabled
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.getBroadcast()
      • setBroadcast

        public void setBroadcast​(boolean broadcast)
        Parameters:
        broadcast - Tells if SO_BROACAST is enabled or not
        See Also:
        DatagramSocket.setBroadcast(boolean)
      • getSendBufferSize

        public int getSendBufferSize()
        Returns:
        the size of the send buffer
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.getSendBufferSize()
      • setSendBufferSize

        public void setSendBufferSize​(int sendBufferSize)
        Parameters:
        sendBufferSize - The size of the send buffer
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.setSendBufferSize(int)
      • isReuseAddress

        public boolean isReuseAddress()
        Tells if SO_REUSEADDR is enabled.
        Returns:
        true if SO_REUSEADDR is enabled
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.getReuseAddress()
      • setReuseAddress

        public void setReuseAddress​(boolean reuseAddress)
        Parameters:
        reuseAddress - Tells if SO_REUSEADDR is enabled or disabled
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.setReuseAddress(boolean)
      • getTrafficClass

        public int getTrafficClass()
        Get the current Traffic Class for this Socket, if any. As this is not a mandatory feature, the returned value should be considered as a hint.
        Returns:
        The Traffic Class supported by this Socket
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.getTrafficClass()
      • setTrafficClass

        public void setTrafficClass​(int trafficClass)
        Parameters:
        trafficClass - The traffic class to set, one of IPTOS_LOWCOST (0x02) IPTOS_RELIABILITY (0x04), IPTOS_THROUGHPUT (0x08) or IPTOS_LOWDELAY (0x10)
        Throws:
        RuntimeIoException - If the socket is closed or if we get an SocketException
        See Also:
        DatagramSocket.setTrafficClass(int)