void
Binds this DatagramSocket to a specific address and port.
protected abstract void
Binds a datagram socket to a local port and address.
void
Connects this socket to a remote socket address (IP address + port number).
protected void
Connects a datagram socket to a remote destination.
protected abstract void
Creates a datagram socket.
boolean
Tests if SO_BROADCAST is enabled.
Get a network interface given its index.
Convenience method to search for a network interface that
has the specified Internet Protocol (IP) address bound to
it.
Searches for the network interface with the specified name.
byte[]
Returns the hardware address (usually MAC) of the interface if it
has one and if it can be accessed given the current privileges.
boolean
boolean
int
Returns the Maximum Transmission Unit (MTU) of this interface.
Get the multicast network interface set.
Returns an Enumeration
of all the interfaces on this machine.
boolean
Fetch the value of an option.
int
Get value of the SO_RCVBUF option for this DatagramSocket
, that is the
buffer size used by the platform for input on this DatagramSocket
.
int
Gets the value of the
SO_RCVBUF
option
for this
ServerSocket
, that is the proposed buffer size that
will be used for Sockets accepted from this
ServerSocket
.
int
Gets the value of the
SO_RCVBUF
option
for this
Socket
, that is the buffer size used by the platform
for input on this
Socket
.
boolean
Tests if SO_REUSEADDR is enabled.
boolean
boolean
int
Get value of the SO_SNDBUF option for this DatagramSocket
, that is the
buffer size used by the platform for output on this DatagramSocket
.
int
Get value of the
SO_SNDBUF
option
for this
Socket
, that is the buffer size used by the platform
for output on this
Socket
.
int
int
Retrieve setting for SO_TIMEOUT. 0 returns implies that the
option is disabled (i.e., timeout of infinity).
int
Returns setting for
SO_TIMEOUT
.
0 returns implies that the option is disabled (i.e., timeout of infinity).
boolean
int
Gets traffic class or type-of-service in the IP datagram
header for packets sent from this DatagramSocket.
int
Gets traffic class or type-of-service in the IP header
for packets sent from this Socket
boolean
Returns whether a network interface is a loopback interface.
boolean
Returns whether a network interface is a point to point interface.
boolean
Returns whether a network interface is up and running.
Returns a Stream
of all the interfaces on this machine.
void
Enable/disable SO_BROADCAST.
void
void
void
void
Specify the network interface for outgoing multicast datagrams
sent on this socket.
void
Enable/disable
SO_OOBINLINE
(receipt of TCP urgent data)
By default, this option is disabled and TCP urgent data received on a
socket is silently discarded.
void
Enable/disable the option specified by optID.
void
Sets the SO_RCVBUF option to the specified value for this
DatagramSocket
.
void
Sets a default proposed value for the
SO_RCVBUF
option for sockets
accepted from this
ServerSocket
.
void
Sets the
SO_RCVBUF
option to the
specified value for this
Socket
.
void
Enable/disable the SO_REUSEADDR socket option.
void
void
void
Sets the SO_SNDBUF option to the specified value for this
DatagramSocket
.
void
Sets the
SO_SNDBUF
option to the
specified value for this
Socket
.
void
Enable/disable
SO_LINGER
with the
specified linger time in seconds.
void
Enable/disable SO_TIMEOUT with the specified timeout, in
milliseconds.
void
Enable/disable
SO_TIMEOUT
with the
specified timeout, in milliseconds.
void
Enable/disable
SO_TIMEOUT
with the specified timeout, in milliseconds.
void
Enable/disable
TCP_NODELAY
(disable/enable Nagle's algorithm).
void
Sets traffic class or type-of-service octet in the IP
datagram header for datagrams sent from this DatagramSocket.
void
Sets traffic class or type-of-service octet in the IP
header for packets sent from this Socket.
boolean
Returns whether a network interface supports multicasting or not.
Constructs a datagram socket and binds it to any available port
on the local host machine.
Constructs a datagram socket and binds it to the specified port
on the local host machine.
Creates a datagram socket, bound to the specified local
address.
Creates a datagram socket, bound to the specified local
socket address.
protected
Creates an unconnected Socket with a user-specified
SocketImpl.