Package 

Class MultiplexedSocket

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable , org.ice4j.socket.MultiplexedXXXSocket

    
    public class MultiplexedSocket
    extends DelegatingSocket implements MultiplexedXXXSocket
                        

    Represents a Socket which receives DatagramPackets selected by a DatagramPacketFilter from a MultiplexingSocket. The associated MultiplexingSocket is the actual Socket which reads the DatagramPackets from the network. The DatagramPackets received through the MultiplexedSocket will not be received through the associated MultiplexingSocket.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      DatagramPacketFilter getFilter() Gets the DatagramPacketFilter} which determines which DatagramPacket}s read from the network are to be received through this socket.
      InputStream getInputStream()
      void close() Closes this datagram socket.
      void receive(DatagramPacket p) Receives a datagram packet from this socket.
      • Methods inherited from class org.ice4j.socket.DelegatingSocket

        bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, receiveFromInputStream, send, sendUrgentData, setKeepAlive, setOOBInline, setOriginalInputStream, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toString
      • Methods inherited from class java.net.Socket

        bind, close, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoLinger, setSoTimeout, setSocketImplFactory, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptions, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getFilter

         DatagramPacketFilter getFilter()

        Gets the DatagramPacketFilter} which determines which DatagramPacket}s read from the network are to be received through this socket.

      • close

         void close()

        Closes this datagram socket.

        Any thread currently blocked in receive upon this socket will throw a SocketException.

      • receive

         void receive(DatagramPacket p)

        Receives a datagram packet from this socket. When this method returns, the DatagramPacket's buffer is filled with the data received. The datagram packet also contains the sender's IP address, and the port number on the sender's machine.

        This method blocks until a datagram is received. The length field of the datagram packet object contains the length of the received message. If the message is longer than the packet's length, the message is truncated.

        Parameters:
        p - the DatagramPacket into which to place the incoming data