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.-
Method Summary
Modifier and TypeMethodDescriptionstatic SocketChannelaccept(ServerSocketChannel serverSocketChannel) static InetAddressaddressByName(String hostname) static Enumeration<InetAddress> static InetAddress[]allAddressesByName(String hostname) static voidbind(Socket socket, SocketAddress bindpoint) static voidbind(DatagramChannel networkChannel, SocketAddress address) static voidbind(SocketChannel socketChannel, SocketAddress address) static voidconnect(Socket socket, SocketAddress remoteAddress, int timeout) static booleanconnect(SocketChannel socketChannel, SocketAddress remoteAddress) static byte[]static SocketAddresslocalSocketAddress(ServerSocket socket) static InetAddressstatic InetSocketAddresssocketAddress(String hostname, int port)
-
Method Details
-
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
-