Package | Description |
---|---|
java.net |
Network communication through TCP and UDP sockets or URLs.
|
Modifier and Type | Method and Description |
---|---|
void |
DatagramSocket.bind(SocketAddress address)
Binds the socket to the given socket address.
|
void |
DatagramSocket.connect(InetAddress address,
int port)
This method connects this socket to the specified address and port.
|
void |
DatagramSocket.connect(SocketAddress address)
Connects the datagram socket to a specified socket address.
|
boolean |
DatagramSocket.getBroadcast()
Checks if SO_BROADCAST is enabled
|
boolean |
Socket.getKeepAlive()
This method returns the value of the socket level socket option
SO_KEEPALIVE.
|
boolean |
Socket.getOOBInline()
Returns the current setting of the SO_OOBINLINE option for this socket
|
int |
Socket.getReceiveBufferSize()
This method returns the value of the system level socket option
SO_RCVBUF, which is used by the operating system to tune buffer
sizes for data transfers.
|
int |
ServerSocket.getReceiveBufferSize()
This method returns the value of the system level socket option SO_RCVBUF,
which is used by the operating system to tune buffer sizes for data
transfers.
|
int |
DatagramSocket.getReceiveBufferSize()
This method returns the value of the system level socket option SO_RCVBUF,
which is used by the operating system to tune buffer sizes for data
transfers.
|
boolean |
Socket.getReuseAddress()
Checks if the SO_REUSEADDR option is enabled
|
boolean |
ServerSocket.getReuseAddress()
Checks if the SO_REUSEADDR option is enabled
|
boolean |
DatagramSocket.getReuseAddress()
Checks if SO_REUSEADDR is enabled.
|
int |
Socket.getSendBufferSize()
This method returns the value of the system level socket option
SO_SNDBUF, which is used by the operating system to tune buffer
sizes for data transfers.
|
int |
DatagramSocket.getSendBufferSize()
This method returns the value of the system level socket option SO_SNDBUF,
which is used by the operating system to tune buffer sizes for data
transfers.
|
int |
Socket.getSoLinger()
Returns the value of the SO_LINGER option on the socket.
|
int |
Socket.getSoTimeout()
Returns the value of the SO_TIMEOUT option on the socket.
|
int |
DatagramSocket.getSoTimeout()
Returns the value of the socket's SO_TIMEOUT setting.
|
boolean |
Socket.getTcpNoDelay()
Tests whether or not the TCP_NODELAY option is set on the socket.
|
int |
Socket.getTrafficClass()
Returns the current traffic class
|
int |
DatagramSocket.getTrafficClass()
Returns the current traffic class
|
void |
DatagramSocket.setBroadcast(boolean enable)
Enables/Disables SO_BROADCAST
|
void |
Socket.setKeepAlive(boolean on)
This method sets the value for the socket level socket option
SO_KEEPALIVE.
|
void |
Socket.setOOBInline(boolean on)
Enables/disables the SO_OOBINLINE option
|
void |
Socket.setReceiveBufferSize(int size)
This method sets the value for the system level socket option
SO_RCVBUF to the specified value.
|
void |
ServerSocket.setReceiveBufferSize(int size)
This method sets the value for the system level socket option SO_RCVBUF to
the specified value.
|
void |
DatagramSocket.setReceiveBufferSize(int size)
This method sets the value for the system level socket option SO_RCVBUF to
the specified value.
|
void |
Socket.setReuseAddress(boolean reuseAddress)
Enables/Disables the SO_REUSEADDR option
|
void |
ServerSocket.setReuseAddress(boolean on)
Enables/Disables the SO_REUSEADDR option
|
void |
DatagramSocket.setReuseAddress(boolean on)
Enables/Disables SO_REUSEADDR.
|
void |
Socket.setSendBufferSize(int size)
This method sets the value for the system level socket option
SO_SNDBUF to the specified value.
|
void |
DatagramSocket.setSendBufferSize(int size)
This method sets the value for the system level socket option SO_SNDBUF to
the specified value.
|
void |
Socket.setSoLinger(boolean on,
int linger)
Sets the value of the SO_LINGER option on the socket.
|
void |
Socket.setSoTimeout(int timeout)
Sets the value of the SO_TIMEOUT option on the socket.
|
void |
ServerSocket.setSoTimeout(int timeout)
Sets the value of SO_TIMEOUT.
|
void |
DatagramSocket.setSoTimeout(int timeout)
Sets the value of the socket's SO_TIMEOUT value.
|
void |
Socket.setTcpNoDelay(boolean on)
Sets the TCP_NODELAY option on the socket.
|
void |
Socket.setTrafficClass(int tc)
Sets the traffic class value
|
void |
DatagramSocket.setTrafficClass(int tc)
Sets the traffic class value
|
Constructor and Description |
---|
DatagramPacket(byte[] buf,
int offset,
int length,
SocketAddress address)
Initializes a new instance of
DatagramPacket for transmitting
packets across the network. |
DatagramPacket(byte[] buf,
int length,
SocketAddress address)
Initializes a new instance of
DatagramPacket for transmitting
packets across the network. |
DatagramSocket()
Initializes a new instance of
DatagramSocket that binds to a
random port and every address on the local machine. |
DatagramSocket(int port)
Initializes a new instance of
DatagramSocket that binds to the
specified port and every address on the local machine. |
DatagramSocket(int port,
InetAddress addr)
Initializes a new instance of
DatagramSocket that binds to the
specified local port and address. |
DatagramSocket(SocketAddress address)
Initializes a new instance of
DatagramSocket that binds to the
specified local port and address. |