org.apache.jcs.auxiliary.lateral.socket.tcp.utils
Class SocketOpener

java.lang.Object
  extended byorg.apache.jcs.auxiliary.lateral.socket.tcp.utils.SocketOpener
All Implemented Interfaces:
java.lang.Runnable

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

Socket openere that will timeout on the initial connect rather than block forever. Technique from core java II.

Version:
$Id: SocketOpener.java,v 1.3 2003/08/22 11:57:20 mpoeschl Exp $
Author:
Aaron Smuts

Field Summary
private  java.lang.String host
           
private  int port
           
private  java.net.Socket socket
           
 
Constructor Summary
SocketOpener(java.lang.String host, int port)
          Constructor for the SocketOpener object
 
Method Summary
 java.net.Socket getSocket()
          Gets the socket attribute of the SocketOpener object
static java.net.Socket openSocket(java.lang.String host, int port, int timeOut)
          Constructor for the SocketOpener object
 void run()
          Main processing method for the SocketOpener object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

private java.lang.String host

port

private int port

socket

private java.net.Socket socket
Constructor Detail

SocketOpener

public SocketOpener(java.lang.String host,
                    int port)
Constructor for the SocketOpener object

Parameters:
host -
port -
Method Detail

openSocket

public static java.net.Socket openSocket(java.lang.String host,
                                         int port,
                                         int timeOut)
Constructor for the SocketOpener object


run

public void run()
Main processing method for the SocketOpener object

Specified by:
run in interface java.lang.Runnable

getSocket

public java.net.Socket getSocket()
Gets the socket attribute of the SocketOpener object