Uses of Class
java.net.InetAddress
Package
Description
A Java API for Stream Control Transport Protocol.
Provides classes that are fundamental to the design of the Java
programming language.
Provides the classes for implementing networking applications.
HTTP Client and WebSocket APIs
Service-provider classes for the
java.net
package.Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
Provides classes for networking applications.
Provides classes for the secure socket package.
This package contains utility classes related to the Kerberos network
authentication protocol.
This package presents a framework that allows application developers to
make use of security services like authentication, data integrity and
data confidentiality from a variety of underlying security mechanisms
like Kerberos, using a unified API.
-
Uses of InetAddress in com.sun.nio.sctp
Modifier and TypeMethodDescriptionabstract SctpChannel
SctpChannel.bindAddress
(InetAddress address) Adds the given address to the bound addresses for the channel's socket.abstract SctpMultiChannel
SctpMultiChannel.bindAddress
(InetAddress address) Adds the given address to the bound addresses for the channel's socket.abstract SctpServerChannel
SctpServerChannel.bindAddress
(InetAddress address) Adds the given address to the bound addresses for the channel's socket.abstract SctpChannel
SctpChannel.unbindAddress
(InetAddress address) Removes the given address from the bound addresses for the channel's socket.abstract SctpMultiChannel
SctpMultiChannel.unbindAddress
(InetAddress address) Removes the given address from the bound addresses for the channel's socket.abstract SctpServerChannel
SctpServerChannel.unbindAddress
(InetAddress address) Removes the given address from the bound addresses for the channel's socket. -
Uses of InetAddress in java.lang
Modifier and TypeMethodDescriptionvoid
SecurityManager.checkMulticast
(InetAddress maddr) Deprecated, for removal: This API element is subject to removal in a future version.Throws aSecurityException
if the calling thread is not allowed to use (join/leave/send/receive) IP multicast.void
SecurityManager.checkMulticast
(InetAddress maddr, byte ttl) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of InetAddress in java.net
Modifier and TypeClassDescriptionfinal class
This class represents an Internet Protocol version 4 (IPv4) address.final class
This class represents an Internet Protocol version 6 (IPv6) address.Modifier and TypeFieldDescriptionprotected InetAddress
SocketImpl.address
The IP address of the remote end of this socket.Modifier and TypeMethodDescriptionDatagramPacket.getAddress()
Returns the IP address of the machine to which this datagram is being sent or from which the datagram was received, ornull
if not set.final InetAddress
InetSocketAddress.getAddress()
Gets theInetAddress
.InterfaceAddress.getAddress()
Returns anInetAddress
for this address.static InetAddress[]
InetAddress.getAllByName
(String host) Given the name of a host, returns an array of its IP addresses, based on the system-wide resolver.InterfaceAddress.getBroadcast()
Returns anInetAddress
for the broadcast address for this InterfaceAddress.static InetAddress
InetAddress.getByAddress
(byte[] addr) Returns anInetAddress
object given the raw IP address .static InetAddress
InetAddress.getByAddress
(String host, byte[] addr) Creates an InetAddress based on the provided host name and IP address.static InetAddress
Determines the IP address of a host, given the host's name.protected InetAddress
URLStreamHandler.getHostAddress
(URL u) Get the IP address of our host.DatagramSocket.getInetAddress()
Returns the address to which this socket is connected.ServerSocket.getInetAddress()
Returns the local address of this server socket.Socket.getInetAddress()
Returns the address to which the socket is connected.protected InetAddress
SocketImpl.getInetAddress()
Returns the value of this socket'saddress
field.MulticastSocket.getInterface()
Deprecated.The network interface may not be uniquely identified by the InetAddress returned.DatagramSocket.getLocalAddress()
Gets the local address to which the socket is bound.Socket.getLocalAddress()
Gets the local address to which the socket is bound.static InetAddress
InetAddress.getLocalHost()
Returns the address of the local host.static InetAddress
InetAddress.getLoopbackAddress()
Returns the loopback address.protected final InetAddress
Authenticator.getRequestingSite()
Gets theInetAddress
of the site requesting authorization, ornull
if not available.static InetAddress
Creates anInetAddress
based on the provided textual representation of an IPv6 address.static InetAddress
Creates anInetAddress
based on the provided textual representation of an IP address.Modifier and TypeMethodDescriptionNetworkInterface.getInetAddresses()
Get an Enumeration with all, or a subset, of the InetAddresses bound to this network interface.NetworkInterface.inetAddresses()
Get a Stream of all, or a subset, of the InetAddresses bound to this network interface.Modifier and TypeMethodDescriptionprotected abstract void
DatagramSocketImpl.bind
(int lport, InetAddress laddr) Binds a datagram socket to a local port and address.protected abstract void
SocketImpl.bind
(InetAddress host, int port) Binds this socket to the specified local IP address and port number.void
DatagramSocket.connect
(InetAddress address, int port) Connects the socket to a remote address for this socket.protected void
DatagramSocketImpl.connect
(InetAddress address, int port) Connects a datagram socket to a remote destination.protected abstract void
SocketImpl.connect
(InetAddress address, int port) Connects this socket to the specified port number on the specified host.static NetworkInterface
NetworkInterface.getByInetAddress
(InetAddress addr) Convenience method to search for a network interface that has the specified Internet Protocol (IP) address bound to it.protected abstract void
DatagramSocketImpl.join
(InetAddress inetaddr) Join the multicast group.void
MulticastSocket.joinGroup
(InetAddress mcastaddr) Deprecated.This method does not accept the network interface on which to join the multicast group.protected abstract void
DatagramSocketImpl.leave
(InetAddress inetaddr) Leave the multicast group.void
MulticastSocket.leaveGroup
(InetAddress mcastaddr) Deprecated.This method does not accept the network interface on which to leave the multicast group.protected abstract int
DatagramSocketImpl.peek
(InetAddress i) Peek at the packet to see who it is from.static PasswordAuthentication
Authenticator.requestPasswordAuthentication
(String host, InetAddress addr, int port, String protocol, String prompt, String scheme) Ask the authenticator that has been registered with the system for a password.static PasswordAuthentication
Authenticator.requestPasswordAuthentication
(String host, InetAddress addr, int port, String protocol, String prompt, String scheme, URL url, Authenticator.RequestorType reqType) Ask the authenticator that has been registered with the system for a password.static PasswordAuthentication
Authenticator.requestPasswordAuthentication
(Authenticator authenticator, String host, InetAddress addr, int port, String protocol, String prompt, String scheme, URL url, Authenticator.RequestorType reqType) Ask the givenauthenticator
for a password.static PasswordAuthentication
Authenticator.requestPasswordAuthentication
(InetAddress addr, int port, String protocol, String prompt, String scheme) Ask the authenticator that has been registered with the system for a password.Authenticator.requestPasswordAuthenticationInstance
(String host, InetAddress addr, int port, String protocol, String prompt, String scheme, URL url, Authenticator.RequestorType reqType) Ask this authenticator for a password.void
DatagramPacket.setAddress
(InetAddress iaddr) Sets the IP address of the machine to which this datagram is being sent.void
MulticastSocket.setInterface
(InetAddress inf) Deprecated.The InetAddress may not uniquely identify the network interface.ModifierConstructorDescriptionDatagramPacket
(byte[] buf, int offset, int length, InetAddress address, int port) Constructs a datagram packet for sending packets of lengthlength
with offsetoffset
to the specified port number on the specified host.DatagramPacket
(byte[] buf, int length, InetAddress address, int port) Constructs a datagram packet for sending packets of lengthlength
to the specified port number on the specified host.DatagramSocket
(int port, InetAddress laddr) Creates a datagram socket, bound to the specified local address.InetSocketAddress
(InetAddress addr, int port) Creates a socket address from an IP address and a port number.ServerSocket
(int port, int backlog, InetAddress bindAddr) Create a server with the specified port, listen backlog, and local IP address to bind to.Socket
(String host, int port, InetAddress localAddr, int localPort) Creates a socket and connects it to the specified remote host on the specified remote port.Socket
(InetAddress address, int port) Creates a stream socket and connects it to the specified port number at the specified IP address.Socket
(InetAddress host, int port, boolean stream) Deprecated, for removal: This API element is subject to removal in a future version.UseDatagramSocket
instead for UDP transport.Socket
(InetAddress address, int port, InetAddress localAddr, int localPort) Creates a socket and connects it to the specified remote address on the specified remote port. -
Uses of InetAddress in java.net.http
Modifier and TypeMethodDescriptiondefault HttpClient.Builder
HttpClient.Builder.localAddress
(InetAddress localAddr) Binds the socket to this local address when creating connections for sending requests. -
Uses of InetAddress in java.net.spi
Modifier and TypeMethodDescriptionInetAddressResolver.lookupByName
(String host, InetAddressResolver.LookupPolicy lookupPolicy) Given the name of a host, returns a stream of IP addresses of the requested address family associated with a provided hostname. -
Uses of InetAddress in java.nio.channels
Modifier and TypeMethodDescriptionabstract InetAddress
MembershipKey.group()
Returns the multicast group for which this membership key was created.abstract InetAddress
MembershipKey.sourceAddress()
Returns the source address if this membership key is source-specific, ornull
if this membership is not source-specific.Modifier and TypeMethodDescriptionabstract MembershipKey
MembershipKey.block
(InetAddress source) Block multicast datagrams from the given source address.MulticastChannel.join
(InetAddress group, NetworkInterface interf) Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key.MulticastChannel.join
(InetAddress group, NetworkInterface interf, InetAddress source) Joins a multicast group to begin receiving datagrams sent to the group from a given source address.abstract MembershipKey
MembershipKey.unblock
(InetAddress source) Unblock multicast datagrams from the given source address that was previously blocked using theblock
method. -
Uses of InetAddress in javax.net
Modifier and TypeMethodDescriptionabstract ServerSocket
ServerSocketFactory.createServerSocket
(int port, int backlog, InetAddress ifAddress) Returns a server socket bound to the specified port, with a specified listen backlog and local IP.abstract Socket
SocketFactory.createSocket
(String host, int port, InetAddress localHost, int localPort) Creates a socket and connects it to the specified remote host on the specified remote port.abstract Socket
SocketFactory.createSocket
(InetAddress host, int port) Creates a socket and connects it to the specified port number at the specified address.abstract Socket
SocketFactory.createSocket
(InetAddress address, int port, InetAddress localAddress, int localPort) Creates a socket and connect it to the specified remote address on the specified remote port. -
Uses of InetAddress in javax.net.ssl
ModifierConstructorDescriptionprotected
SSLServerSocket
(int port, int backlog, InetAddress address) Used only by subclasses.protected
SSLSocket
(String host, int port, InetAddress clientAddress, int clientPort) Used only by subclasses.protected
SSLSocket
(InetAddress address, int port) Used only by subclasses.protected
SSLSocket
(InetAddress address, int port, InetAddress clientAddress, int clientPort) Used only by subclasses. -
Uses of InetAddress in javax.security.auth.kerberos
Modifier and TypeMethodDescriptionfinal InetAddress[]
KerberosTicket.getClientAddresses()
Returns a list of addresses from where the ticket can be used.ModifierConstructorDescriptionKerberosTicket
(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, byte[] sessionKey, int keyType, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses) Constructs aKerberosTicket
using credentials information that a client either receives from a KDC or reads from a cache. -
Uses of InetAddress in org.ietf.jgss
Modifier and TypeMethodDescriptionChannelBinding.getAcceptorAddress()
Get the acceptor's address for this channel binding.ChannelBinding.getInitiatorAddress()
Get the initiator's address for this channel binding.ModifierConstructorDescriptionChannelBinding
(InetAddress initAddr, InetAddress acceptAddr, byte[] appData) Create a ChannelBinding object with user supplied address information and data.