connection
Class SocketToMe

java.lang.Object
  extended byjava.lang.Thread
      extended byconnection.SocketToMe
All Implemented Interfaces:
Communicator, java.lang.Runnable

public class SocketToMe
extends java.lang.Thread
implements Communicator

Author:
DanO A quick way to communicate via socket. To just send things out you can just instantiate this class with null for the _parent. To also listen back to this guy you will have to implement the Communicator interface and pass along "this" from the calling class to be able to get messages back from the socket.

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SocketToMe(int _port, Communicator _parent)
           
 
Method Summary
 java.lang.String getAddress()
           
 java.io.PrintStream getPrintStream()
           
 void kill()
           
 void messageFromOutside(java.lang.String s)
           
 void run()
           
 java.lang.String send(java.lang.String output)
           
 java.lang.String sendToFlash(java.lang.String output)
           
 void setPrintStream(java.io.PrintStream ps)
           
 void statusFromOutside(java.lang.String s)
           
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketToMe

public SocketToMe(int _port,
                  Communicator _parent)
Method Detail

kill

public void kill()

getAddress

public java.lang.String getAddress()

getPrintStream

public java.io.PrintStream getPrintStream()

run

public void run()
Specified by:
run in interface java.lang.Runnable

sendToFlash

public java.lang.String sendToFlash(java.lang.String output)

send

public java.lang.String send(java.lang.String output)

statusFromOutside

public void statusFromOutside(java.lang.String s)
Specified by:
statusFromOutside in interface Communicator

messageFromOutside

public void messageFromOutside(java.lang.String s)
Specified by:
messageFromOutside in interface Communicator

setPrintStream

public void setPrintStream(java.io.PrintStream ps)
Specified by:
setPrintStream in interface Communicator