public class TimedConnection extends ConnectionBase
MONITOR_PORT, REMOTE_SERVER_IP, SERVER_IP, SERVER_PORT
Constructor and Description |
---|
TimedConnection(int millis) |
Modifier and Type | Method and Description |
---|---|
void |
establishConnection()
Creates a connection to the server and initializes the input and output
stream
|
void |
sendMessage(byte[] msg)
Sends the passed message to the server
|
void |
startReceiveLoop()
Starts the receive loop that only ends once the socket is shutdown
|
attach, isConnected, stopReceiveLoop
public TimedConnection(int millis)
host
- port
- millis
- the number of milli seconds to triggerpublic 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 occured