Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marauroa.net
Class NetworkClientManager  view NetworkClientManager download NetworkClientManager.java

java.lang.Object
  extended bymarauroa.net.NetworkClientManager

public class NetworkClientManager
extends java.lang.Object

The NetworkClientManager is in charge of sending and recieving the packages from the network.


Nested Class Summary
private static class NetworkClientManager.PacketContainer
           
 
Field Summary
private  java.net.InetSocketAddress address
           
private  int clientid
           
private  MessageFactory msgFactory
           
private  java.util.Map pendingPackets
           
private  java.net.DatagramSocket socket
           
 
Constructor Summary
NetworkClientManager(java.lang.String host)
          Constructor that opens the socket on the marauroa_PORT and start the thread to recieve new messages from the network.
 
Method Summary
 void addMessage(Message msg)
          This method add a message to be delivered to the client the message is pointed to.
 void finish()
          This method notify the thread to finish it execution
 Message getMessage()
          This method returns a message if it is available or null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

private java.net.DatagramSocket socket

address

private java.net.InetSocketAddress address

clientid

private int clientid

msgFactory

private MessageFactory msgFactory

pendingPackets

private java.util.Map pendingPackets
Constructor Detail

NetworkClientManager

public NetworkClientManager(java.lang.String host)
                     throws java.net.SocketException
Constructor that opens the socket on the marauroa_PORT and start the thread to recieve new messages from the network.

Method Detail

finish

public void finish()
This method notify the thread to finish it execution


getMessage

public Message getMessage()
This method returns a message if it is available or null


addMessage

public void addMessage(Message msg)
This method add a message to be delivered to the client the message is pointed to.