public class UDPConnection extends SocketConnection
MONITOR_PORT, REMOTE_SERVER_IP, SERVER_IP, SERVER_PORT
Constructor and Description |
---|
UDPConnection(java.lang.String host,
int port,
int bufferSize,
IByteBufferReceiver receiver)
Default
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnection() |
void |
establishConnection()
Creates a connection to the server and initializes the input and output
stream
|
void |
establishSending() |
void |
sendMessage(byte[] msg)
Sends the passed message to the server
|
void |
setReceiver(IByteBufferReceiver receiver) |
void |
startReceiveLoop()
Starts the receive loop that only ends once the socket is shutdown
|
attach, isConnected, stopReceiveLoop
public UDPConnection(java.lang.String host, int port, int bufferSize, IByteBufferReceiver receiver)
public void establishSending() throws ConnectionException
ConnectionException
public void establishConnection() throws ConnectionException
IServerConnection
ConnectionException
public void sendMessage(byte[] msg) throws ConnectionException
IServerConnection
msg
- the message to sendConnectionException
public void startReceiveLoop() throws ConnectionException
IServerConnection
ConnectionException
- if any connection problem occuredpublic void setReceiver(IByteBufferReceiver receiver)
public void closeConnection()