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