public class SocketOpener
extends java.lang.Object
implements java.lang.Runnable
Socket opener that will timeout on the initial connect rather than block forever. Technique from core java II.
Constructor and Description |
---|
SocketOpener(java.lang.String host,
int port)
Constructor for the SocketOpener object
|
Modifier and Type | Method and Description |
---|---|
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
|
public SocketOpener(java.lang.String host, int port)
host
- port
- public static java.net.Socket openSocket(java.lang.String host, int port, int timeOut)
host
- port
- timeOut
- public void run()
run
in interface java.lang.Runnable
public java.net.Socket getSocket()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.