com.mindbright.net
public class SocketFactory extends java.lang.Object
Constructor and Description |
---|
SocketFactory() |
Modifier and Type | Method and Description |
---|---|
static java.nio.channels.SocketChannel |
newSocket(java.net.InetAddress ia,
int port)
Connects to the given server.
|
static java.nio.channels.SocketChannel |
newSocket(java.net.InetAddress ia,
int port,
long mstimeout)
Connects to the given server.
|
static java.nio.channels.SocketChannel |
newSocket(java.lang.String host,
int port)
Connects to the given server.
|
static java.nio.channels.SocketChannel |
newSocket(java.lang.String host,
int port,
long mstimeout)
Connects to the given server.
|
public static java.nio.channels.SocketChannel newSocket(java.net.InetAddress ia, int port) throws java.io.IOException
ia
- Address of server to connect toport
- Port to connect tojava.io.IOException
- If there are any errors during the
connection.public static java.nio.channels.SocketChannel newSocket(java.lang.String host, int port) throws java.net.UnknownHostException, java.io.IOException
host
- Name of server to connect toport
- Port to connect tojava.io.IOException
- If there are any errors during the
connection.java.net.UnknownHostException
public static java.nio.channels.SocketChannel newSocket(java.lang.String host, int port, long mstimeout) throws java.net.UnknownHostException, java.io.IOException
host
- Name of server to connect toport
- Port to connect tomstimeout
- How many millisecondse to wait before giving upjava.io.IOException
- If there are any errors during the
connection or if the connection has not
been established before mstimeout
milliseconds have passwd.java.net.UnknownHostException
public static java.nio.channels.SocketChannel newSocket(java.net.InetAddress ia, int port, long mstimeout) throws java.io.IOException
ia
- Address of server to connect toport
- Port to connect tomstimeout
- How many millisecondse to wait before giving upjava.io.IOException
- If there are any errors during the
connection or if the connection has not
been established before mstimeout
milliseconds have passwd.