|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnap.net.NetHelper
public class NetHelper
Provides a set of static methods for common network tasks.
| Nested Class Summary | |
|---|---|
static class |
NetHelper.SocketConnector
|
| Constructor Summary | |
|---|---|
NetHelper()
|
|
| Method Summary | |
|---|---|
static java.net.Socket |
connect(java.lang.String host,
int port,
long timeout)
|
static void |
disableHttpProxy()
Disables the use of a http proxy. |
static void |
disableSocksProxy()
Disables the use of a socks proxy. |
static void |
enableHttpProxy(java.lang.String host,
int port)
Enables the use of a http proxy at host:port. |
static void |
enableSocksProxy(java.lang.String host,
int port)
Enables the use of a socks proxy at host:port. |
static java.lang.String |
getErrorMessage(java.io.IOException e)
Returns a sensible error message. |
static long |
ipToLongHiFirst(byte[] address)
|
static java.lang.String |
toIP(long ip)
Converts ip from an integer value to a dotted string
representation. |
static java.lang.String |
toIP(java.lang.String ip)
Converts ip from an integer value to a dotted string
representation. |
static java.lang.String |
toIPHiFirst(long ip)
Converts ip from an integer value to a dotted string
representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NetHelper()
| Method Detail |
|---|
public static void enableSocksProxy(java.lang.String host,
int port)
host:port.
host - hostname of the proxyhost - port of the proxypublic static void disableSocksProxy()
public static void enableHttpProxy(java.lang.String host,
int port)
host:port.
host - hostname of the proxyhost - port of the proxypublic static void disableHttpProxy()
public static java.lang.String getErrorMessage(java.io.IOException e)
public static long ipToLongHiFirst(byte[] address)
public static java.lang.String toIP(java.lang.String ip)
ip from an integer value to a dotted string
representation.
toIP(long)public static java.lang.String toIP(long ip)
ip from an integer value to a dotted string
representation.
public static java.lang.String toIPHiFirst(long ip)
ip from an integer value to a dotted string
representation.
public static java.net.Socket connect(java.lang.String host,
int port,
long timeout)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||