issrg.test.repository
Class ProxySocketThread

java.lang.Object
  extended by issrg.test.repository.ProxySocketThread
All Implemented Interfaces:
java.lang.Runnable

public class ProxySocketThread
extends java.lang.Object
implements java.lang.Runnable

This a proxy for relaying internet traffic between the local host and a remote server. Its main purpose is to be able to stop this forwarding so as to simulate an 'unreachable' server.

Author:
Linying Su

Constructor Summary
ProxySocketThread(java.net.ServerSocket server, java.lang.String host, int port)
          Creates an instance of ProxySocketThread.
 
Method Summary
 void run()
          Starts relaying the traffic between the ServerSocket on the local host and the actual server.
 void stop()
          Stops the relaying of traffic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxySocketThread

public ProxySocketThread(java.net.ServerSocket server,
                         java.lang.String host,
                         int port)
Creates an instance of ProxySocketThread.

Parameters:
server - the localhost server socket
host - the remote server host name
port - the remote server port
Method Detail

run

public void run()
Starts relaying the traffic between the ServerSocket on the local host and the actual server.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Stops the relaying of traffic.