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 374766 2006-02-03 22:37:10Z asmuts $

Constructor Summary
SocketOpener(java.lang.String host, int port)
          Constructor for the SocketOpener object
 
Method Summary
 java.net.Socket getSocket()
           
static java.net.Socket openSocket(java.lang.String host, int port, int timeOut)
          Opens a socket with a connection timeout value.
 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
 

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)
Opens a socket with a connection timeout value. Joins against a backgroud thread that does the openeing.

Parameters:
host -
port -
timeOut -
Returns:
Socket

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()
Returns:
The opened socket


Copyright © 2002-2007 Apache Software Foundation. All Rights Reserved.