| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static InetAddress | |
| private static String | |
| private static long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ServerSocket | Returns: nullthe socket socket)Close a server socket and ignore any exceptions. |
| public static Socket | Returns: the socketthe port port, boolean if SSL should be used ssl)Create a loopback socket (a socket that is connected to localhost) on this port. |
| public static ServerSocket | Returns: the server socketthe port to listen on port, boolean if SSL should be used ssl)Create a server socket. |
| private static ServerSocket | |
| public static Socket | Returns: the socketto connect to (including an optional port) server, int the default port (if not specified in the server
address) defaultPort, boolean if SSL should be used ssl)Create a client socket that is connected to the given address and port. |
| public static Socket | Returns: the socketto connect to (including an optional port) server, int the default port (if not specified in the server
address) defaultPort, boolean if SSL should be used ssl, int socket so timeout networkTimeout)Create a client socket that is connected to the given address and port. |
| public static Socket | Returns: the socketthe address to connect to address, int the port port, boolean if SSL should be used ssl)Create a client socket that is connected to the given address and port. |
| public static Socket | Returns: the socketthe address to connect to address, int the port port, boolean if SSL should be used ssl, int socket so timeout networkTimeout)Create a client socket that is connected to the given address and port. |
| private static InetAddress | Returns: the bind addressGet the bind address if the system property h2.bindAddress is set, or null if not. |
| public static String | Returns: the host name, or another text if not availablethe local address localAddress)Get the host name of a local address, if available. |
| public static synchronized String | |
| public static StringBuilder | Returns: the specified or the new string builder with short representation of specified addressstring builder to append to, or builder, byte[] nullIP address address, boolean if ( addBrackets)true, add brackets around IPv6 addressesAppends short representation of the specified IP address to the string builder. |
| public static boolean | Returns: true if it isthe socket socket)Check if a socket is connected to a local address. |
| CACHE_MILLIS | back to summary |
|---|---|
| private static final int CACHE_MILLIS | |
| cachedBindAddress | back to summary |
|---|---|
| private static InetAddress cachedBindAddress | |
| cachedLocalAddress | back to summary |
|---|---|
| private static String cachedLocalAddress | |
| cachedLocalAddressTime | back to summary |
|---|---|
| private static long cachedLocalAddressTime | |
| NetUtils | back to summary |
|---|---|
| private NetUtils() | |
| closeSilently | back to summary |
|---|---|
| public static ServerSocket closeSilently(ServerSocket socket) Close a server socket and ignore any exceptions.
| |
| createLoopbackSocket | back to summary |
|---|---|
| public static Socket createLoopbackSocket(int port, boolean ssl) throws IOException Create a loopback socket (a socket that is connected to localhost) on this port.
| |
| createServerSocket | back to summary |
|---|---|
| public static ServerSocket createServerSocket(int port, boolean ssl) Create a server socket. The system property h2.bindAddress is used if set.
| |
| createServerSocketTry | back to summary |
|---|---|
| private static ServerSocket createServerSocketTry(int port, boolean ssl) | |
| createSocket | back to summary |
|---|---|
| public static Socket createSocket(String server, int defaultPort, boolean ssl) throws IOException Create a client socket that is connected to the given address and port.
| |
| createSocket | back to summary |
|---|---|
| public static Socket createSocket(String server, int defaultPort, boolean ssl, int networkTimeout) throws IOException Create a client socket that is connected to the given address and port.
| |
| createSocket | back to summary |
|---|---|
| public static Socket createSocket(InetAddress address, int port, boolean ssl) throws IOException Create a client socket that is connected to the given address and port.
| |
| createSocket | back to summary |
|---|---|
| public static Socket createSocket(InetAddress address, int port, boolean ssl, int networkTimeout) throws IOException Create a client socket that is connected to the given address and port.
| |
| getBindAddress | back to summary |
|---|---|
| private static InetAddress getBindAddress() throws UnknownHostException Get the bind address if the system property h2.bindAddress is set, or null if not.
| |
| getHostName | back to summary |
|---|---|
| public static String getHostName(String localAddress) Get the host name of a local address, if available. | |
| getLocalAddress | back to summary |
|---|---|
| public static synchronized String getLocalAddress() Get the local host address as a string. For performance, the result is cached for one second.
| |
| ipToShortForm | back to summary |
|---|---|
| public static StringBuilder ipToShortForm(StringBuilder builder, byte[] address, boolean addBrackets) Appends short representation of the specified IP address to the string builder.
| |
| isLocalAddress | back to summary |
|---|---|
| public static boolean isLocalAddress(Socket socket) throws UnknownHostException Check if a socket is connected to a local address.
| |