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

Quick Search    Search Deep

org.lucane.client
Class Listener  view Listener download Listener.java

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.lucane.client.Listener
All Implemented Interfaces:
java.lang.Runnable

class Listener
extends java.lang.Thread

A Listener is the client's "server" part


Nested Class Summary
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  Client parent
           
private  int port
           
private  java.net.ServerSocket socket
           
private  boolean stop
           
private  boolean stopThread
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Listener()
          Constructor.
 
Method Summary
private  void getMessage(java.net.Socket s)
          Read messages from the network
 int getPort()
          Get the listening port
private  void internalCommand(org.lucane.common.Message message)
          Handles internal commands
 void listen()
          Accept all connections.
 void pleaseStop()
          Stop the listener.
 void run()
          Called by listen().
private  void setUserList(java.lang.String data)
          Update the user list
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Field Detail

socket

private java.net.ServerSocket socket

parent

private Client parent

stopThread

private boolean stopThread

stop

private boolean stop

port

private int port
Constructor Detail

Listener

public Listener()
Constructor. Initialize the ServerSocket

Method Detail

listen

public void listen()
Accept all connections. Start a new Thread.


run

public void run()
Called by listen(). You don't need to start the thread by yourself.


getMessage

private void getMessage(java.net.Socket s)
Read messages from the network


internalCommand

private void internalCommand(org.lucane.common.Message message)
Handles internal commands


setUserList

private void setUserList(java.lang.String data)
Update the user list


pleaseStop

public void pleaseStop()
Stop the listener.


getPort

public int getPort()
Get the listening port