simulator
Class Listener

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--simulator.Listener

class Listener
extends java.lang.Thread

Listener thread-class of input socket stream. It's execute this two steps:


Field Summary
protected  Client applet
          Contains the instance to the applet
protected  boolean running
          This flag indicates if listener is running
protected  java.io.DataInputStream sin
          This is the input socket stream used to comunicate
protected  java.awt.TextArea window
          Contains the reference to an TextArea where we write the message that server send us
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
Listener(java.net.Socket s, java.awt.TextArea window, Client applet)
          Initialize object and start the thread
 
Method Summary
 void run()
          Listen the socket and write message line in the TextArea
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sin

protected java.io.DataInputStream sin
This is the input socket stream used to comunicate

window

protected java.awt.TextArea window
Contains the reference to an TextArea where we write the message that server send us

running

protected boolean running
This flag indicates if listener is running

applet

protected Client applet
Contains the instance to the applet
Constructor Detail

Listener

public Listener(java.net.Socket s,
                java.awt.TextArea window,
                Client applet)
Initialize object and start the thread
Parameters:
s - the socket to comunicate
window - a TextArea where we write line
applet - an applet of the Client type
Method Detail

run

public void run()
Listen the socket and write message line in the TextArea
Overrides:
run in class java.lang.Thread