-
- All Implemented Interfaces:
public abstract class IceSocketWrapperAbstract socket wrapper that define a socket that could be UDP, TCP...
-
-
Method Summary
Modifier and Type Method Description abstract 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. abstract voidreceive(DatagramPacket p)Receives a DatagramPacket from this socket. abstract voidclose()Closes this socket. abstract InetAddressgetLocalAddress()Get local address. abstract intgetLocalPort()Get local port. abstract SocketAddressgetLocalSocketAddress()Get socket address. abstract SocketgetTCPSocket()Returns Socket object if the delegate socket is a TCP one, null otherwise. abstract DatagramSocketgetUDPSocket()Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise. -
-
Method Detail
-
send
abstract 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.
- Parameters:
p- DatagramPacket to send
-
receive
abstract 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.
- Parameters:
p- DatagramPacket
-
close
abstract void close()
Closes this socket.
-
getLocalAddress
abstract InetAddress getLocalAddress()
Get local address.
-
getLocalPort
abstract int getLocalPort()
Get local port.
-
getLocalSocketAddress
abstract SocketAddress getLocalSocketAddress()
Get socket address.
-
getTCPSocket
abstract Socket getTCPSocket()
Returns Socket object if the delegate socket is a TCP one, null otherwise.
-
getUDPSocket
abstract DatagramSocket getUDPSocket()
Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise.
-
-
-
-