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

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

public class SocketOpener
extends Object
implements Runnable

Since 1.4, we can specify the timeout in the connect block, we no longer need the extra thread to join against the Socket creation.


Constructor Summary
SocketOpener(String host, int port, int timeout)
          Constructor for the SocketOpener object
 
Method Summary
 Socket getSocket()
           
static Socket openSocket(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(String host,
                    int port,
                    int timeout)
Constructor for the SocketOpener object

Parameters:
host -
port -
timeout - connect timeout
Method Detail

openSocket

public static Socket openSocket(String host,
                                int port,
                                int timeOut)
Opens a socket with a connection timeout value.

Parameters:
host -
port -
timeOut -
Returns:
Socket

run

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

Specified by:
run in interface Runnable

getSocket

public Socket getSocket()
Returns:
The opened socket


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