public class ConnectionToServer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ConnectionToServer.WriterToServer
Should include all actions to send a full command to the server.
|
Constructor and Description |
---|
ConnectionToServer()
creates the connection to server.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
completeAddress(java.lang.String address) |
java.lang.String |
connectToAddressAndGetApplication(java.lang.String address) |
int |
getPort() |
MessageReader |
getReader() |
java.lang.String |
getServer() |
void |
resetSendingMessage() |
void |
sendMessage(ConnectionToServer.WriterToServer writertoserver)
Sends the message to the server, restarting the connection if necessary
|
void |
stopConnection()
cancels and closes the connections
|
public ConnectionToServer()
public void sendMessage(ConnectionToServer.WriterToServer writertoserver) throws java.net.UnknownHostException, java.io.IOException
writertoserver
- function to send the message to the serverjava.net.UnknownHostException
java.io.IOException
public java.lang.String getServer()
public int getPort()
public java.lang.String connectToAddressAndGetApplication(java.lang.String address) throws java.io.IOException
address
- the local address (action reference)java.io.IOException
public MessageReader getReader()
public java.lang.String completeAddress(java.lang.String address)
address
- the local address of an actionpublic void stopConnection() throws java.io.IOException
java.io.IOException
public void resetSendingMessage()