|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.IPUtils
Utility methods for use by IP based transports.
Field Summary | |
static InetAddress |
ANYADDRESS
Constant which works as the IP "Any Address" value |
static InetAddress |
ANYADDRESSV4
|
static InetAddress |
ANYADDRESSV6
|
(package private) static String |
IPV4ANYADDRESS
|
(package private) static String |
IPV4LOOPBACK
|
(package private) static String |
IPV6ANYADDRESS
|
(package private) static String |
IPV6LOOPBACK
|
static InetAddress |
LOOPBACK
Constant which works as the IP "Local Loopback" value; |
static InetAddress |
LOOPBACKV4
|
static InetAddress |
LOOPBACKV6
|
(package private) static Random |
random
|
(package private) static int |
rangesize
Size of port groups we will probe. |
Method Summary | |
static Socket |
connectToFrom(InetAddress inetAddress,
int port,
InetAddress usingInterface,
int localPort,
int timeout)
Create a client socket using the configured socketFactory or connectToFromNoFactory if none is available. |
static Socket |
connectToFromNoFactory(InetAddress inetAddress,
int port,
InetAddress usingInterface,
int localPort,
int timeout)
Create a client socket with the JDK1.4 method connect(). |
static Iterator |
getAllLocalAddresses()
Provide an iterator which returns all of the local InetAddresses for this host. |
static ServerSocketFactory |
getServerSocketFactory()
returns the ServerSocketFactory to create server sockets, or null if new SeverSocket() is being used. |
static SocketFactory |
getSocketFactory()
returns the socketFactory used by connectToFrom() to create sockets, or null if connectToFromNoFactory() is being used. |
static ServerSocket |
openServerSocketInRange(int start,
int end,
int backlog,
InetAddress bindAddress)
Open a ServerSocket in the specified range. |
static void |
setServerSocketFactory(ServerSocketFactory sf)
makes connectToFrom create sockets with this factory. |
static void |
setSocketFactory(SocketFactory sf)
makes connectToFrom create sockets with this factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final Random random
static final String IPV4ANYADDRESS
static final String IPV6ANYADDRESS
static final String IPV4LOOPBACK
static final String IPV6LOOPBACK
public static final InetAddress ANYADDRESS
public static InetAddress ANYADDRESSV4
public static InetAddress ANYADDRESSV6
public static final InetAddress LOOPBACK
public static InetAddress LOOPBACKV4
public static InetAddress LOOPBACKV6
static final int rangesize
Method Detail |
public static Iterator getAllLocalAddresses()
public static Socket connectToFrom(InetAddress inetAddress, int port, InetAddress usingInterface, int localPort, int timeout) throws IOException
IOException
public static Socket connectToFromNoFactory(InetAddress inetAddress, int port, InetAddress usingInterface, int localPort, int timeout) throws IOException
IOException
public static void setSocketFactory(SocketFactory sf)
sf
- is the socket factory to use or null if you want the
default behaviour provided by connectToFromNoFactory().public static SocketFactory getSocketFactory()
public static void setServerSocketFactory(ServerSocketFactory sf)
sf
- is the socket factory to use or null if you want the
default behaviour provided by new SeverSocket().public static ServerSocketFactory getServerSocketFactory()
public static ServerSocket openServerSocketInRange(int start, int end, int backlog, InetAddress bindAddress) throws IOException
start
- The lowest numbered port to try.end
- The highest numbered port to try.backlog
- the allowed backlog of unaccepted connections.
IOException
- when the socket cannot be opened. (Lame, but that's what ServerSocket says).
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |