server
Class FishTankServerClientManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--server.FishTankServerClientManager
All Implemented Interfaces:
java.lang.Runnable

public class FishTankServerClientManager
extends java.lang.Thread

Thread that manages a connection to the server. This will allow multiple people to be connected to the server at one time.

Author:
Ben Litchfield

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FishTankServerClientManager(java.net.Socket clientSocket, java.lang.ThreadGroup g, ServerInfo my, java.util.Vector f, ServerStatPanel m, PulseServer pul)
          constructor for FishTankClientManager.
 
Method Summary
 void close()
          close this connection and kill this thread
 void getFish()
          send the vector of fish to the client
 void getStat()
          send the statistics panel to the client
 void run()
          this is what is run when someone connects.
 void sendFish()
          this is called when accepting a fish from a server or a client
 void sendLocal()
          send the location of all the fish to all of the clients
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FishTankServerClientManager

public FishTankServerClientManager(java.net.Socket clientSocket,
                                   java.lang.ThreadGroup g,
                                   ServerInfo my,
                                   java.util.Vector f,
                                   ServerStatPanel m,
                                   PulseServer pul)
constructor for FishTankClientManager.

Parameters:
clientSocket - the socket that the connection is coming from
g - the ThreadGroup that manages all of the connections
my - the ServerInfo of the server that is running
f - the vector of fish that are on the server
m - the Panel that shows the servers statistics
pul - the PulserServer
Method Detail

run

public void run()
this is what is run when someone connects. It listens for commands from the person connected and then do whatever with them

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

close

public void close()
close this connection and kill this thread


sendFish

public void sendFish()
this is called when accepting a fish from a server or a client


sendLocal

public void sendLocal()
send the location of all the fish to all of the clients


getStat

public void getStat()
send the statistics panel to the client


getFish

public void getFish()
send the vector of fish to the client