fi.utu.cs.hockey.net
Class Server

java.lang.Object
  |
  +--fi.utu.cs.hockey.net.Server

public class Server
extends java.lang.Object

A hockey game server.


Constructor Summary
Server(int sPort, int iPort, java.lang.String gAddr, int gPort, Game g)
          Constructs a server for the hockey game g.
 
Method Summary
 void sendGameState()
          Sends the current game state to the clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server(int sPort,
              int iPort,
              java.lang.String gAddr,
              int gPort,
              Game g)
Constructs a server for the hockey game g. The server has two ports, one for initialization and one for receiving input from the clients. The server sends output to a multicast group. Hence, parameter gAddr must be a D-class address (i.e., within the range 224.0.0.0-239.255.255.255). Preferably, it should be from the range 239.0.0.0-239.255.255.255 which is intended for local area network (LAN) use only.

Parameters:
sPort - Server port for client input
iPort - Server port for client initialization
gAddr - Multicast group for server output
gPort - Multicast port
g - Hockey game
Method Detail

sendGameState

public void sendGameState()
Sends the current game state to the clients.