eap.freeciv
Class Client

java.lang.Object
  extended byeap.freeciv.Client
All Implemented Interfaces:
PacketListener

public class Client
extends Object
implements PacketListener


Constructor Summary
Client()
           
 
Method Summary
 void connectToServer(String name, int port)
           
 PacketConnection getConnection()
           
static void main(String[] args)
           
 void receivePacket(Packet packet)
          A PacketConnection calls this method for every registered listener every time it reads a packet from its underlying socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client()
Method Detail

getConnection

public PacketConnection getConnection()

connectToServer

public void connectToServer(String name,
                            int port)
                     throws UnknownHostException,
                            IOException
Throws:
UnknownHostException
IOException

receivePacket

public void receivePacket(Packet packet)
Description copied from interface: PacketListener
A PacketConnection calls this method for every registered listener every time it reads a packet from its underlying socket. Listeners should not modify the packet unless they can be sure noone else is listening. This is because a PacketConnection does not guarantee the order in which it passes packets to its registered listeners.

Specified by:
receivePacket in interface PacketListener

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception