eap.freeciv
Class Client
java.lang.Object
eap.freeciv.Client
- All Implemented Interfaces:
- PacketListener
- public class Client
- extends Object
- implements PacketListener
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Client
public Client()
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