Class CommunicationChannel

public class CommunicationChannel

The class handles UDP network traffic from/to the rcssserver.

Version:
1.1
Author:
Kuehne, Markus Beier
Field Detail

socket

private DatagramSocket socket
socket for incoming, outgoing messages

serverAddress

InetAddress serverAddress
IP address of the server

serverPort

private int serverPort
port number of the server

Constructor Detail

CommunicationChannel

public CommunicationChannel(String serverName,
                            int serverPort)
Creates a new CommunicationChannel 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(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 String receive()
Receives a message from the server
Returns:
a String containing the message read from the socket