-
- All Implemented Interfaces:
public class IceTcpSocketWrapper extends IceSocketWrapper
TCP implementation of the IceSocketWrapper.
-
-
Constructor Summary
Constructors Constructor Description IceTcpSocketWrapper(Socket delegate)Constructor.
-
Method Summary
Modifier and Type Method Description voidclose()Closes this socket. InetAddressgetLocalAddress()Get local address. intgetLocalPort()Get local port. SocketAddressgetLocalSocketAddress()Get socket address. SocketgetTCPSocket()Returns Socket object if the delegate socket is a TCP one, null otherwise. DatagramSocketgetUDPSocket()Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise. voidreceive(DatagramPacket p)Receives a DatagramPacket from this socket. voidsend(DatagramPacket p)Sends a DatagramPacket from this socket It is a utility method to provide a common way to send for both UDP and TCP socket. -
-
Constructor Detail
-
IceTcpSocketWrapper
IceTcpSocketWrapper(Socket delegate)
Constructor.- Parameters:
delegate- delegate Socket
-
-
Method Detail
-
close
void close()
Closes this socket.
-
getLocalAddress
InetAddress getLocalAddress()
Get local address.
-
getLocalPort
int getLocalPort()
Get local port.
-
getLocalSocketAddress
SocketAddress getLocalSocketAddress()
Get socket address.
-
getTCPSocket
Socket getTCPSocket()
Returns Socket object if the delegate socket is a TCP one, null otherwise.
-
getUDPSocket
DatagramSocket getUDPSocket()
Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise.
-
receive
void receive(DatagramPacket p)
Receives a DatagramPacket from this socket. It is a utility method to provide a common way to receive for both UDP and TCP socket. If the underlying socket is a TCP one, it is still possible to get the InputStream and do stuff with it.
-
send
void send(DatagramPacket p)
Sends a DatagramPacket from this socket It is a utility method to provide a common way to send for both UDP and TCP socket. If the underlying socket is a TCP one, it is still possible to get the OutputStream and do stuff with it.
-
-
-
-