|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Network
Network interface provides low-level networking features.
Nested Class Summary | |
---|---|
static interface |
Network.Port
A listening port. |
Field Summary | |
---|---|
static int |
SECURE_NONE
SSL is not enabled for this connection. |
static int |
SECURE_OPTIONAL
SSL is optional for this connection; try SSL first, if it fails then try a normal connection. |
static int |
SECURE_REQUIRED
SSL is required for this connection. |
Method Summary | |
---|---|
java.net.Socket |
connect(java.lang.String host,
int port,
int timeout)
Connect to the given address using an insecure (non-SSL) connection and return a connected socket. |
java.net.Socket |
connect(java.lang.String host,
int port,
int timeout,
int secureMode)
Connect to the given address and return a connected socket. |
java.net.InetAddress |
getPublicAddress()
Obtains the current public address. |
Network.Port |
listen()
Open a public TCP port to listen for connections. |
Network.Port |
listen(java.lang.String remoteHost)
Open a public TCP port to listen for connections from a specific host. |
boolean |
needsListenTarget()
|
void |
reportPublicAddress(java.net.InetAddress ia)
Report a possible public address that has been detected from another system (i.e. report from server). |
Field Detail |
---|
static final int SECURE_NONE
static final int SECURE_OPTIONAL
static final int SECURE_REQUIRED
Method Detail |
---|
java.net.Socket connect(java.lang.String host, int port, int timeout) throws java.io.IOException
host
- Host name or IP stringport
- Port numbertimeout
- Timeout in milliseconds
java.io.IOException
java.net.Socket connect(java.lang.String host, int port, int timeout, int secureMode) throws java.io.IOException
host
- Host name or IP stringport
- Port numbertimeout
- Timeout in millisecondssecureMode
- SECURE_xx constant
java.io.IOException
boolean needsListenTarget()
java.net.InetAddress getPublicAddress()
Network.Port listen() throws java.io.IOException
java.io.IOException
- If there are any problems creating the portvoid reportPublicAddress(java.net.InetAddress ia)
ia
- Possible public address (will be ignored if it isn't)Network.Port listen(java.lang.String remoteHost) throws java.io.IOException
remoteHost
- Remote host address that will connect
java.io.IOException
- If there are any problems creating the port
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |