Package io.netty.util.internal
Class SocketUtils
java.lang.Object
io.netty.util.internal.SocketUtils
Provides socket operations with privileges enabled. This is necessary for applications that use the
SecurityManager
to restrict SocketPermission
to their application. By asserting that these
operations are privileged, the operations can proceed even if some code in the calling chain lacks the appropriate
SocketPermission
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SocketChannel
accept
(ServerSocketChannel serverSocketChannel) static InetAddress
addressByName
(String hostname) static Enumeration
<InetAddress> static InetAddress[]
allAddressesByName
(String hostname) static void
bind
(Socket socket, SocketAddress bindpoint) static void
bind
(DatagramChannel networkChannel, SocketAddress address) static void
bind
(SocketChannel socketChannel, SocketAddress address) static void
connect
(Socket socket, SocketAddress remoteAddress, int timeout) static boolean
connect
(SocketChannel socketChannel, SocketAddress remoteAddress) private static <T> Enumeration
<T> empty()
static byte[]
static SocketAddress
localSocketAddress
(ServerSocket socket) static InetAddress
static InetSocketAddress
socketAddress
(String hostname, int port)
-
Field Details
-
EMPTY
-
-
Constructor Details
-
SocketUtils
private SocketUtils()
-
-
Method Details
-
empty
-
connect
public static void connect(Socket socket, SocketAddress remoteAddress, int timeout) throws IOException - Throws:
IOException
-
bind
- Throws:
IOException
-
connect
public static boolean connect(SocketChannel socketChannel, SocketAddress remoteAddress) throws IOException - Throws:
IOException
-
bind
- Throws:
IOException
-
accept
- Throws:
IOException
-
bind
- Throws:
IOException
-
localSocketAddress
-
addressByName
- Throws:
UnknownHostException
-
allAddressesByName
- Throws:
UnknownHostException
-
socketAddress
-
addressesFromNetworkInterface
-
loopbackAddress
-
hardwareAddressFromNetworkInterface
public static byte[] hardwareAddressFromNetworkInterface(NetworkInterface intf) throws SocketException - Throws:
SocketException
-