|
Secure iNet Factory | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jscape.inet.util.TimedSocket
public class TimedSocket
Implements methods for creating sockets within a defined timeout.
Timeout is based upon time to establish connection, as well as reading blocking I/O data from the incoming socket connection.
String hostname = "www.myserver.com";
int port = 80;
int timeout = 5000; // 5 seconds
try
{
Socket con = TimedSocket.getSocket(hostname,port,timeout);
}
catch(Exception ioe)
{
// handle exception
}
| Method Summary | |
|---|---|
static java.net.Socket |
getSocket(java.net.InetAddress addr,
int port,
java.net.InetAddress localAddr,
int localPort,
long delay)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.net.InetAddress addr,
int port,
java.net.InetAddress localAddr,
int localPort,
long delay,
int sendBuffer,
int receiveBuffer)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.net.InetAddress addr,
int port,
long delay)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.net.InetAddress addr,
int port,
long delay,
int sendBuffer,
int receiveBuffer)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.lang.String host,
int port,
long delay)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.lang.String host,
int port,
long delay,
int sendBuffer,
int receiveBuffer)
Creates a new Socket instance. |
static java.net.Socket |
getSocket(java.lang.String host,
int port,
long delay,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyType)
Creates a new Socket instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.net.Socket getSocket(java.net.InetAddress addr,
int port,
java.net.InetAddress localAddr,
int localPort,
long delay)
throws java.io.IOException
Socket instance.
addr - the InetAddress to connect toport - the port to connect tolocalAddr - the local InetAddress to connect fromlocalPort - the local port to connect fromdelay - timeout in milliseconds
Socket
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.net.InetAddress addr,
int port,
java.net.InetAddress localAddr,
int localPort,
long delay,
int sendBuffer,
int receiveBuffer)
throws java.io.IOException
Socket instance.
addr - the InetAddress to connect toport - the port to connect tolocalAddr - the local InetAddress to connect fromlocalPort - the local port to connect fromdelay - timeout in millisecondssendBuffer - Send socket buffer value.receiveBuffer - Receive socket buffer value
Socket
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.net.InetAddress addr,
int port,
long delay)
throws java.io.IOException
Socket instance.
addr - the InetAddress to connect toport - the port to connect todelay - timeout in milliseconds
Socket
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.net.InetAddress addr,
int port,
long delay,
int sendBuffer,
int receiveBuffer)
throws java.io.IOException
Socket instance.
addr - the InetAddress to connect toport - the port to connect todelay - timeout in milliseconds
Socket
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.lang.String host,
int port,
long delay,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyType)
throws java.io.IOException
Socket instance.
host - the host to connect toport - the port to connect todelay - timeout in millisecondsproxyHost - the proxy host to connect throughproxyPort - the proxy port to connect onproxyUsername - The username to useproxyPassword - The proxy password to useproxyType - either HTTP or SOCKS5
Socket instance
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.lang.String host,
int port,
long delay)
throws java.io.IOException
Socket instance.
host - the host to connect toport - the port to connect todelay - timeout in milliseconds
Socket
java.io.IOException - timeout is reached or other I/O error occurs
public static java.net.Socket getSocket(java.lang.String host,
int port,
long delay,
int sendBuffer,
int receiveBuffer)
throws java.io.IOException
Socket instance.
host - the host to connect toport - the port to connect todelay - timeout in milliseconds
Socket
java.io.IOException - timeout is reached or other I/O error occurs
|
Secure iNet Factory | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||