Class CommunicationChannel
java.lang.Object
|
+--CommunicationChannel
- public class CommunicationChannel
- extends java.lang.Object
CommunicationChannel
The class handles UDP network traffic from/to the rcssserver.
- Version:
- 1.1
- Author:
- Gerald Kuehne, Markus Beier
Field Summary |
(package private) java.net.InetAddress |
serverAddress
IP address of the server |
private int |
serverPort
port number of the server |
private java.net.DatagramSocket |
socket
socket for incoming, outgoing messages |
Constructor Summary |
CommunicationChannel(java.lang.String serverName,
int serverPort)
Creates a new CommunicationChannel 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
- socket for incoming, outgoing messages
serverAddress
java.net.InetAddress serverAddress
- IP address of the server
serverPort
private int serverPort
- port number of the server
CommunicationChannel
public CommunicationChannel(java.lang.String serverName,
int serverPort)
- Creates a new
CommunicationChannel
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