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

Field Summary
(package private)  java.net.InetAddress serverAddress
           
private  int serverPort
           
private  java.net.DatagramSocket socket
           
 
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
 

Field Detail

socket

private java.net.DatagramSocket socket

serverAddress

java.net.InetAddress serverAddress

serverPort

private int serverPort
Constructor Detail

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 address
serverPort - The port of the server
Method Detail

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