Create a read/write datagram socket
Populate the provided array from the socket. This will stall until some data is available, or a timeout occurs. We assume the datagram has been connected.
Read bytes from an available datagram into the given array. When provided, the 'from' address will be populated with the origin of the incoming data. Note that we employ the timeout mechanics exposed via our Socket superclass.
Write the provided content to the socket. This will stall until the socket responds in some manner. We assume the datagram has been connected.
Write an array to the specified address. If address 'to' is null, it is assumed the socket has been connected instead.
see super.timeout(int)
Return the name of this device
Models a handle-oriented device.
Return the socket wrapper
Return a preferred size for buffering conduit I/O
Connect to the provided endpoint
Connect to the provided endpoint
Bind this socket. This is typically used to configure a listening socket (such as a server or multicast socket). The address given should describe a local adapter, or specify the port alone (ADDR_ANY) to have the OS assign a local adapter address.
Inform other end of a connected socket that we're no longer available. In general, this should be invoked before close()
Release this Socket
Read content from the socket. Note that the operation may timeout if method setTimeout() has been invoked with a non-zero value.
Transfer the content of another conduit to this one. Returns the dst OutputStream, or throws IOException on failure.
Manage socket IO under a timeout
Throw an IOException noting the last error
Datagrams provide a low-overhead, non-reliable data transmission mechanism.
Datagrams are not 'connected' in the same manner as a TCP socket; you don't need to listen() or accept() to receive a datagram, and data may arrive from multiple sources. A datagram socket may, however, still use the connect() method like a TCP socket. When connected, the read() and write() methods will be restricted to a single address rather than being open instead. That is, applying connect() will make the address argument to both read() and write() irrelevant. Without connect(), method write() must be supplied with an address and method read() should be supplied with one to identify where data originated.
Note that when used as a listener, you must first bind the socket to a local adapter. This can be achieved by binding the socket to an InternetAddress constructed with a port only (ADDR_ANY), thus requesting the OS to assign the address of a local network adapter