kaos.robots.naimtsimulator
Class ReconnectSocket

java.lang.Object
  extended by kaos.robots.naimtsimulator.ReconnectSocket

public class ReconnectSocket
extends java.lang.Object

A server socket that allows for reconnection. Consider the following scenario. You have a simulator and a visualizer. The simulator uses a ReconnectSocket socket to send updates to the visualizer. You're working on the visualizer, so you'd like to be able to run a test, stop the the visualizer, and then restart it without having to do anything special on the simulator side. If that's what you want, then this is the socket for you!


Field Summary
static java.lang.String CONNECTION_IP_ADDRESS
           
 
Constructor Summary
ReconnectSocket(int port)
           
 
Method Summary
 void close()
           
 java.lang.String get()
           
 java.io.BufferedReader getIn()
           
 java.io.PrintWriter getOut()
           
protected  void handleLostConnection()
           
 void put(java.lang.String s)
           
static ReconnectSocket serveOn(int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_IP_ADDRESS

public static java.lang.String CONNECTION_IP_ADDRESS
Constructor Detail

ReconnectSocket

public ReconnectSocket(int port)
Method Detail

serveOn

public static ReconnectSocket serveOn(int port)

close

public void close()

put

public void put(java.lang.String s)

get

public java.lang.String get()

getIn

public java.io.BufferedReader getIn()

getOut

public java.io.PrintWriter getOut()

handleLostConnection

protected void handleLostConnection()