-
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final DatagramPacketFilterfilterprivate final InputStreaminputStream
-
Method Summary
Modifier and Type Method Description DatagramPacketFiltergetFilter()Gets the DatagramPacketFilter} which determines which DatagramPacket}s read from the network are to be received through this socket. InputStreamgetInputStream()voidclose()Closes this datagram socket. voidreceive(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
-
-
Method Detail
-
getFilter
DatagramPacketFilter getFilter()
Gets the DatagramPacketFilter} which determines which DatagramPacket}s read from the network are to be received through this socket.
-
getInputStream
InputStream getInputStream()
-
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
-
-
-
-