Top Description Fields Constructors Methods
io.netty.util.internal

public final Class SocketUtils

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.InetAddress, .InetSocketAddress, .NetworkInterface, .ServerSocket, .Socket, .SocketAddress, .SocketException, .SocketPermission, .UnknownHostException, java.nio.channels.DatagramChannel, .ServerSocketChannel, .SocketChannel, java.security.AccessController, .PrivilegedAction, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.Collections, .Enumeration

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

Modifier and TypeField and Description
private static final Enumeration<Object>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SocketChannel
accept(final ServerSocketChannel serverSocketChannel)

public static InetAddress
addressByName(final String hostname)

public static Enumeration<InetAddress>
public static InetAddress[]
allAddressesByName(final String hostname)

public static void
bind(final Socket socket, final SocketAddress bindpoint)

public static void
bind(final SocketChannel socketChannel, final SocketAddress address)

public static void
bind(final DatagramChannel networkChannel, final SocketAddress address)

public static void
connect(final Socket socket, final SocketAddress remoteAddress, final int timeout)

public static boolean
connect(final SocketChannel socketChannel, final SocketAddress remoteAddress)

private static <T> Enumeration<T>
public static byte[]
public static SocketAddress
public static InetAddress
public static InetSocketAddress
socketAddress(final String hostname, final int port)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final Enumeration<Object> EMPTY

Constructor Detail

SocketUtilsback to summary
private SocketUtils()

Method Detail

acceptback to summary
public static SocketChannel accept(final ServerSocketChannel serverSocketChannel) throws IOException
addressByNameback to summary
public static InetAddress addressByName(final String hostname) throws UnknownHostException
addressesFromNetworkInterfaceback to summary
public static Enumeration<InetAddress> addressesFromNetworkInterface(final NetworkInterface intf)
allAddressesByNameback to summary
public static InetAddress[] allAddressesByName(final String hostname) throws UnknownHostException
bindback to summary
public static void bind(final Socket socket, final SocketAddress bindpoint) throws IOException
bindback to summary
public static void bind(final SocketChannel socketChannel, final SocketAddress address) throws IOException
Annotations
@SuppressJava6Requirement
reason:Usage guarded by java version check
bindback to summary
public static void bind(final DatagramChannel networkChannel, final SocketAddress address) throws IOException
Annotations
@SuppressJava6Requirement
reason:Usage guarded by java version check
connectback to summary
public static void connect(final Socket socket, final SocketAddress remoteAddress, final int timeout) throws IOException
connectback to summary
public static boolean connect(final SocketChannel socketChannel, final SocketAddress remoteAddress) throws IOException
emptyback to summary
private static <T> Enumeration<T> empty()
Annotations
@SuppressWarnings:unchecked
hardwareAddressFromNetworkInterfaceback to summary
public static byte[] hardwareAddressFromNetworkInterface(final NetworkInterface intf) throws SocketException
localSocketAddressback to summary
public static SocketAddress localSocketAddress(final ServerSocket socket)
loopbackAddressback to summary
public static InetAddress loopbackAddress()
Annotations
@SuppressJava6Requirement
reason:Usage guarded by java version check
socketAddressback to summary
public static InetSocketAddress socketAddress(final String hostname, final int port)