Class Communication

java.lang.Object
  |
  +--Communication

public class Communication
extends java.lang.Object

The Communication class takes care of the server-client UDP-Packet-transmission. This one is called by each Player-class.

Author:
Wini Appl
See Also:
Player

Field Summary
private  java.net.DatagramSocket datagramSocket
          initializes a new Datagram Socket-class
private  java.net.InetAddress serverIP
          this java-own class represents an Internet Protocol-address
private  int serverPort
           
 
Constructor Summary
Communication(java.lang.String serverName, int serverPort)
          Constructor of another Communication instance; handles transfer errors.
Author: Wini Appl
 
Method Summary
 java.lang.String receive()
          The Receive-method fetches data from the server and passes it on to the Worldmodel.
Author: Wini Appl
 void send(java.lang.String input)
          The Send-method converts any incoming input-string into a byte-array and sends it to the server.
Author: Wini Appl
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

datagramSocket

private java.net.DatagramSocket datagramSocket
initializes a new Datagram Socket-class

serverIP

private java.net.InetAddress serverIP
this java-own class represents an Internet Protocol-address

serverPort

private int serverPort
Constructor Detail

Communication

public Communication(java.lang.String serverName,
                     int serverPort)
Constructor of another Communication instance; handles transfer errors.

Author: Wini Appl

Parameters:
serverName - Name of the RoboCupServer one wants to connect to.
serverPort - Portnumber of the RoboCupServer one wants to connect to.
Method Detail

send

public void send(java.lang.String input)
The Send-method converts any incoming input-string into a byte-array and sends it to the server.

Author: Wini Appl

Parameters:
input - sends the parsed String to aboves Server
See Also:
Communication(String serverName, int serverPort), Parser

receive

public java.lang.String receive()
The Receive-method fetches data from the server and passes it on to the Worldmodel.

Author: Wini Appl

Returns:
Received Data is getting fetched by the Parser for further treatment.
See Also:
Parser