Uses of Class
java.net.SocketAddress
Packages that useSocketAddress
Package
Description
A Java API for Stream Control Transport Protocol.
Provides the classes for implementing networking applications.
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.
Uses ofSocketAddress incom.sun.nio.sctp
Fields incom.sun.nio.sctp with type parameters of typeSocketAddressModifier and TypeFieldDescriptionstatic finalSctpSocketOption<SocketAddress>SctpStandardSocketOptions.SCTP_PRIMARY_ADDRRequests that the local SCTP stack use the given peer address as the association primary.static finalSctpSocketOption<SocketAddress>SctpStandardSocketOptions.SCTP_SET_PEER_PRIMARY_ADDRRequests that the peer mark the enclosed address as the association primary.Methods incom.sun.nio.sctp that returnSocketAddressModifier and TypeMethodDescriptionabstractSocketAddressMessageInfo.address()Returns the source socket address if the message has been received, otherwise the preferred destination of the message to be sent.abstractSocketAddressPeerAddressChangeNotification.address()Returns the peer address.abstractSocketAddressSendFailedNotification.address()Returns the address.Methods incom.sun.nio.sctp that return types with arguments of typeSocketAddressModifier and TypeMethodDescriptionabstractSet<SocketAddress>SctpChannel.getAllLocalAddresses()Returns all of the socket addresses to which this channel's socket is bound.abstractSet<SocketAddress>SctpMultiChannel.getAllLocalAddresses()Returns all of the socket addresses to which this channel's socket is bound.abstractSet<SocketAddress>SctpServerChannel.getAllLocalAddresses()Returns all of the socket addresses to which this channel's socket is bound.abstractSet<SocketAddress>SctpChannel.getRemoteAddresses()Returns all of the remote addresses to which this channel's socket is connected.abstractSet<SocketAddress>SctpMultiChannel.getRemoteAddresses(Association association) Returns all of the remote addresses to which the given association on this channel's socket is connected.Methods incom.sun.nio.sctp with parameters of typeSocketAddressModifier and TypeMethodDescriptionabstractSctpChannelSctpChannel.bind(SocketAddress local) Binds the channel's socket to a local address.finalSctpMultiChannelSctpMultiChannel.bind(SocketAddress local) Binds the channel's socket to a local address and configures the socket to listen for connections.abstractSctpMultiChannelSctpMultiChannel.bind(SocketAddress local, int backlog) Binds the channel's socket to a local address and configures the socket to listen for connections.finalSctpServerChannelSctpServerChannel.bind(SocketAddress local) Binds the channel's socket to a local address and configures the socket to listen for associations.abstractSctpServerChannelSctpServerChannel.bind(SocketAddress local, int backlog) Binds the channel's socket to a local address and configures the socket to listen for associations.abstract booleanSctpChannel.connect(SocketAddress remote) Connects this channel's socket.abstract booleanSctpChannel.connect(SocketAddress remote, int maxOutStreams, int maxInStreams) Connects this channel's socket.staticMessageInfoMessageInfo.createOutgoing(Association association,SocketAddress address, int streamNumber) Creates aMessageInfoinstance suitable for use when sending a message to a given association.staticMessageInfoMessageInfo.createOutgoing(SocketAddress address, int streamNumber) Creates aMessageInfoinstance suitable for use when sending a message.staticSctpChannelSctpChannel.open(SocketAddress remote, int maxOutStreams, int maxInStreams) Opens an SCTP channel and connects it to a remote address.Uses ofSocketAddress injava.net
Subclasses ofSocketAddress injava.netModifier and TypeClassDescriptionclassThis class implements an IP Socket Address (IP address + port number) It can also be a pair (hostname + port number), in which case an attempt will be made to resolve the hostname.final classA Unix domain socket address.Methods injava.net that returnSocketAddressModifier and TypeMethodDescriptionProxy.address()Returns the socket address of the proxy, ornullif its a direct connection.DatagramSocket.getLocalSocketAddress()Returns the address of the endpoint this socket is bound to.ServerSocket.getLocalSocketAddress()Returns the address of the endpoint this socket is bound to.Socket.getLocalSocketAddress()Returns the address of the endpoint this socket is bound to.DatagramSocket.getRemoteSocketAddress()Returns the address of the endpoint this socket is connected to, ornullif it is unconnected.Socket.getRemoteSocketAddress()Returns the address of the endpoint this socket is connected to, ornullif it is unconnected.DatagramPacket.getSocketAddress()Returns theSocketAddress(usuallyIP address +port number) of the remote host that this packet is being sent to or is coming from.Methods injava.net with parameters of typeSocketAddressModifier and TypeMethodDescriptionvoidDatagramSocket.bind(SocketAddress addr) Binds this DatagramSocket to a specific address and port.voidServerSocket.bind(SocketAddress endpoint) Binds theServerSocketto a specific address (IP address and port number).voidServerSocket.bind(SocketAddress endpoint, int backlog) Binds theServerSocketto a specific address (IP address and port number).voidSocket.bind(SocketAddress bindpoint) Binds the socket to a local address.voidDatagramSocket.connect(SocketAddress addr) Connects this socket to a remote socket address (IP address + port number).voidSocket.connect(SocketAddress endpoint) Connects this socket to the server.voidSocket.connect(SocketAddress endpoint, int timeout) Connects this socket to the server with a specified timeout value.protected abstract voidSocketImpl.connect(SocketAddress address, int timeout) Connects this socket to the specified port number on the specified host.abstract voidProxySelector.connectFailed(URI uri,SocketAddress sa,IOException ioe) Called to indicate that a connection could not be established to a proxy/socks server.voidDatagramSocket.joinGroup(SocketAddress mcastaddr,NetworkInterface netIf) Joins a multicast group.protected abstract voidDatagramSocketImpl.joinGroup(SocketAddress mcastaddr,NetworkInterface netIf) Join the multicast group.voidMulticastSocket.joinGroup(SocketAddress mcastaddr,NetworkInterface netIf) Joins a multicast group.voidDatagramSocket.leaveGroup(SocketAddress mcastaddr,NetworkInterface netIf) Leave a multicast group on a specified local interface.protected abstract voidDatagramSocketImpl.leaveGroup(SocketAddress mcastaddr,NetworkInterface netIf) Leave the multicast group.voidMulticastSocket.leaveGroup(SocketAddress mcastaddr,NetworkInterface netIf) Leave a multicast group on a specified local interface.voidDatagramPacket.setSocketAddress(SocketAddress address) Sets the SocketAddress (usually IP address + port number) of the remote host to which this datagram is being sent.Constructors injava.net with parameters of typeSocketAddressModifierConstructorDescriptionDatagramPacket(byte[] buf, int offset, int length,SocketAddress address) Constructs a datagram packet for sending packets of lengthlengthwith offsetoffsetto the specified port number on the specified host.DatagramPacket(byte[] buf, int length,SocketAddress address) Constructs a datagram packet for sending packets of lengthlengthto the specified port number on the specified host.DatagramSocket(SocketAddress bindaddr) Creates a datagram socket, bound to the specified local socket address.MulticastSocket(SocketAddress bindaddr) Creates a multicast socket, bound to the specified local socket address.Proxy(Proxy.Type type,SocketAddress sa) Creates an entry representing a PROXY connection.Uses ofSocketAddress injava.nio.channels
Methods injava.nio.channels that returnSocketAddressModifier and TypeMethodDescriptionabstractSocketAddressAsynchronousServerSocketChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.abstractSocketAddressAsynchronousSocketChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.abstractSocketAddressDatagramChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.NetworkChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.abstractSocketAddressServerSocketChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.abstractSocketAddressSocketChannel.getLocalAddress()Returns the socket address that this channel's socket is bound to.abstractSocketAddressAsynchronousSocketChannel.getRemoteAddress()Returns the remote address to which this channel's socket is connected.abstractSocketAddressDatagramChannel.getRemoteAddress()Returns the remote address to which this channel's socket is connected.abstractSocketAddressSocketChannel.getRemoteAddress()Returns the remote address to which this channel's socket is connected.abstractSocketAddressDatagramChannel.receive(ByteBuffer dst) Receives a datagram via this channel.Methods injava.nio.channels with parameters of typeSocketAddressModifier and TypeMethodDescriptionAsynchronousServerSocketChannel.bind(SocketAddress local) Binds the channel's socket to a local address and configures the socket to listen for connections.abstractAsynchronousServerSocketChannelAsynchronousServerSocketChannel.bind(SocketAddress local, int backlog) Binds the channel's socket to a local address and configures the socket to listen for connections.abstractAsynchronousSocketChannelAsynchronousSocketChannel.bind(SocketAddress local) abstractDatagramChannelDatagramChannel.bind(SocketAddress local) NetworkChannel.bind(SocketAddress local) Binds the channel's socket to a local address.finalServerSocketChannelServerSocketChannel.bind(SocketAddress local) Binds the channel's socket to a local address and configures the socket to listen for connections.abstractServerSocketChannelServerSocketChannel.bind(SocketAddress local, int backlog) Binds the channel's socket to a local address and configures the socket to listen for connections.abstractSocketChannelSocketChannel.bind(SocketAddress local) Binds the channel's socket to a local address.AsynchronousSocketChannel.connect(SocketAddress remote) Connects this channel.abstract <A> voidAsynchronousSocketChannel.connect(SocketAddress remote, A attachment,CompletionHandler<Void, ? super A> handler) Connects this channel.abstractDatagramChannelDatagramChannel.connect(SocketAddress remote) Connects this channel's socket.abstract booleanSocketChannel.connect(SocketAddress remote) Connects this channel's socket.staticSocketChannelSocketChannel.open(SocketAddress remote) Opens a socket channel and connects it to a remote address.abstract intDatagramChannel.send(ByteBuffer src,SocketAddress target) Sends a datagram via this channel.