Class Communication
java.lang.Object
|
+--Communication
- public class Communication
- extends java.lang.Object
Communication
The class handles UDP network traffic from/to the rcssserver.
- Version:
- 1.0
- Author:
- Gerald Kuehne, Markus Beier
Constructor Summary |
Communication(java.lang.String serverName,
int serverPort)
Creates a new Communication instance. |
Method Summary |
java.lang.String |
receive()
Receives a message from the server |
void |
send(java.lang.String message)
Sends a String to the server |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
socket
private java.net.DatagramSocket socket
serverAddress
java.net.InetAddress serverAddress
serverPort
private int serverPort
Communication
public Communication(java.lang.String serverName,
int serverPort)
- Creates a new
Communication
instance.
- Parameters:
serverName
- The address of the server specified by its name or its IP addressserverPort
- The port of the server
send
public void send(java.lang.String message)
- Sends a
String
to the server
- Parameters:
message
- a String
value containing the message which
has to be sent to the server.
receive
public java.lang.String receive()
- Receives a message from the server
- Returns:
- a
String
containing the message read from the socket