public abstract class IceSocketWrapper extends Object
Constructor and Description |
---|
IceSocketWrapper() |
Modifier and Type | Method and Description |
---|---|
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.
|
abstract void |
receive(DatagramPacket p)
Receives a DatagramPacket from this socket.
|
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.
|
public abstract void send(DatagramPacket p) throws IOException
p
- DatagramPacket to sendIOException
- if something goes wrongpublic abstract void receive(DatagramPacket p) throws IOException
p
- DatagramPacketIOException
- if something goes wrongpublic abstract void close()
public abstract InetAddress getLocalAddress()
public abstract int getLocalPort()
public abstract SocketAddress getLocalSocketAddress()
public abstract Socket getTCPSocket()
public abstract DatagramSocket getUDPSocket()
Copyright © 2018. All rights reserved.