| Package | Description |
|---|---|
| java.net |
Provides the classes for implementing networking applications.
|
| java.nio.channels |
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.
|
| Modifier and Type | Class and Description |
|---|---|
class |
InetSocketAddress
This 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.
|
| Modifier and Type | Method and Description |
|---|---|
SocketAddress |
Proxy.address()
Returns the socket address of the proxy, or
null if its a direct connection.
|
SocketAddress |
Socket.getLocalSocketAddress()
Returns the address of the endpoint this socket is bound to.
|
SocketAddress |
DatagramSocket.getLocalSocketAddress()
Returns the address of the endpoint this socket is bound to.
|
SocketAddress |
ServerSocket.getLocalSocketAddress()
Returns the address of the endpoint this socket is bound to.
|
SocketAddress |
Socket.getRemoteSocketAddress()
Returns the address of the endpoint this socket is connected to, or
null if it is unconnected.
|
SocketAddress |
DatagramSocket.getRemoteSocketAddress()
Returns the address of the endpoint this socket is connected to, or
null if it is unconnected.
|
SocketAddress |
DatagramPacket.getSocketAddress()
Gets the SocketAddress (usually IP address + port number) of the remote host that this packet is being sent to or is coming from.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Socket.bind(SocketAddress
Binds the socket to a local address.
|
void |
DatagramSocket.bind(SocketAddress
Binds this DatagramSocket to a specific address and port.
|
void |
ServerSocket.bind(SocketAddress
Binds the
ServerSocket to a specific address (IP address and port number).
|
void |
ServerSocket.bind(SocketAddress
Binds the
ServerSocket to a specific address (IP address and port number).
|
void |
Socket.connect(SocketAddress
Connects this socket to the server.
|
void |
DatagramSocket.connect(SocketAddress
Connects this socket to a remote socket address (IP address + port number).
|
void |
Socket.connect(SocketAddress
Connects this socket to the server with a specified timeout value.
|
protected abstract void |
SocketImpl.connect(SocketAddress
Connects this socket to the specified port number on the specified host.
|
abstract void |
ProxySelector.connectFailed(URI
Called to indicate that a connection could not be established to a proxy/socks server.
|
void |
MulticastSocket.joinGroup(SocketAddress
Joins the specified multicast group at the specified interface.
|
protected abstract void |
DatagramSocketImpl.joinGroup(SocketAddress
Join the multicast group.
|
void |
MulticastSocket.leaveGroup(SocketAddress
Leave a multicast group on a specified local interface.
|
protected abstract void |
DatagramSocketImpl.leaveGroup(SocketAddress
Leave the multicast group.
|
void |
DatagramPacket.setSocketAddress(SocketAddress
Sets the SocketAddress (usually IP address + port number) of the remote host to which this datagram is being sent.
|
| Constructor and Description | |
|---|---|
DatagramPacket(byte[] buf, int offset, int length, SocketAddress
Constructs a datagram packet for sending packets of length
length with offset
ioffsetto the specified port number on the specified host.
|
|
DatagramPacket(byte[] buf, int length, SocketAddress
Constructs a datagram packet for sending packets of length
length to the specified port number on the specified host.
|
|
DatagramSocket(SocketAddress
Creates a datagram socket, bound to the specified local socket address.
|
|
MulticastSocket(SocketAddress
Create a MulticastSocket bound to the specified socket address.
|
|
Proxy(Proxy
Creates an entry representing a PROXY connection.
|
| Modifier and Type | Method and Description |
|---|---|
abstract SocketAddress |
DatagramChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
abstract SocketAddress |
ServerSocketChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
abstract SocketAddress |
AsynchronousServerSocketChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
abstract SocketAddress |
AsynchronousSocketChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
abstract SocketAddress |
SocketChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
SocketAddress |
NetworkChannel.getLocalAddress()
Returns the socket address that this channel's socket is bound to.
|
abstract SocketAddress |
DatagramChannel.getRemoteAddress()
Returns the remote address to which this channel's socket is connected.
|
abstract SocketAddress |
AsynchronousSocketChannel.getRemoteAddress()
Returns the remote address to which this channel's socket is connected.
|
abstract SocketAddress |
SocketChannel.getRemoteAddress()
Returns the remote address to which this channel's socket is connected.
|
abstract SocketAddress |
DatagramChannel.receive(ByteBuffer
Receives a datagram via this channel.
|
| Modifier and Type | Method and Description |
|---|---|
abstract DatagramChannel |
DatagramChannel.bind(SocketAddress
|
ServerSocketChannel |
ServerSocketChannel.bind(SocketAddress
Binds the channel's socket to a local address and configures the socket to listen for connections.
|
AsynchronousServerSocketChannel |
AsynchronousServerSocketChannel.bind(SocketAddress
Binds the channel's socket to a local address and configures the socket to listen for connections.
|
abstract AsynchronousSocketChannel |
AsynchronousSocketChannel.bind(SocketAddress
|
abstract SocketChannel |
SocketChannel.bind(SocketAddress
|
NetworkChannel |
NetworkChannel.bind(SocketAddress
Binds the channel's socket to a local address.
|
abstract ServerSocketChannel |
ServerSocketChannel.bind(SocketAddress
Binds the channel's socket to a local address and configures the socket to listen for connections.
|
abstract AsynchronousServerSocketChannel |
AsynchronousServerSocketChannel.bind(SocketAddress
Binds the channel's socket to a local address and configures the socket to listen for connections.
|
abstract DatagramChannel |
DatagramChannel.connect(SocketAddress
Connects this channel's socket.
|
abstract Future |
AsynchronousSocketChannel.connect(SocketAddress
Connects this channel.
|
abstract boolean |
SocketChannel.connect(SocketAddress
Connects this channel's socket.
|
abstract <A> void |
AsynchronousSocketChannel.connect(SocketAddress
Connects this channel.
|
static SocketChannel |
SocketChannel.open(SocketAddress
Opens a socket channel and connects it to a remote address.
|
abstract int |
DatagramChannel.send(ByteBuffer
Sends a datagram via this channel.
|