DatagramSocketclass SetSendBufferSize() method example. This example shows you how to use SetSendBufferSize() method.This method Sets the SO_SNDBUF option to the specified value for this DatagramSocket.
DatagramSocketclass SetReuseAddress() method example. This example shows you how to use SetReuseAddress() method.This method Enable/disable the SO_REUSEADDR socket option.
DatagramSocketclass SetReceiveBufferSize() method example. This example shows you how to use SetReceiveBufferSize() method.This method Sets the SO_RCVBUF option to the specified value for this DatagramSocket.
DatagramSocketclass IsConnected() method example. This example shows you how to use IsConnected() method.This method Returns the connection state of the socket.
DatagramSocketclass isClosed() method example. This example shows you how to use isClosed() method.This method Returns whether the socket is closed or not.
DatagramSocketclass GetTrafficClass() method example. This example shows you how to use GetTrafficClass() method.This method Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket.
DatagramSocketclass GetSoTimeout() method example. This example shows you how to use GetSoTimeout() method.This method Retrieve setting for SO_TIMEOUT.
DatagramSocketclass GetSendBufferSize() method example. This example shows you how to use GetSendBufferSize() method.This method Get value of the SO_SNDBUF option for this DatagramSocket, that is the buffer size used by the platform for output on this DatagramSocket.
DatagramSocketclass GetReuseAddress() method example. This example shows you how to use GetReuseAddress() method.This method Tests if SO_REUSEADDR is enabled.
DatagramSocketclass GetRemoteSocketAddress() method example. This example shows you how to use GetRemoteSocketAddress() method.This method Returns a SocketAddress representing the remote endpoint of this socket, or null if it is not connected yet.
DatagramSocketclass GetReceiveBufferSize() method example. This example shows you how to use GetReceiveBufferSize() method.This method Returns the value of the SO_RCVBUF option for this DatagramSocket
Socket class getTrafficClass example. public int getTrafficClass() throws SocketException Gets traffic class or type-of-service in the IP header for packets sent from this Socket As the underlying network implementation may ignore the traffic class or type-of-service set using setTrafficClass(int) this method may return a different value than was previously set using the setTrafficClass(int) method on this Socket.
DatagramSocketclass GetLocalSocketAddress() method example. This example shows you how to use GetLocalSocketAddress() method.This method Returns the address of the endpoint this socket is bound to, or null if it is not bound yet.
DatagramSocketclass GetLocalPort() method example. This example shows you how to use GetLocalPort() method.This method Returns the port number on the local host to which this socket is bound.
DatagramSocketclass GetLocalAddress() method example. This example shows you how to use GetLocalAddress() method.This method Gets the local address to which the socket is bound.
Socket class getSoTimeout example. public int getSoTimeout()
throws SocketException
Returns setting for SO_TIMEOUT. 0 returns implies that the option is disabled (i.e., timeout of infinity).
DatagramSocketclass getInetAddress() method example. This example shows you how to use getInetAddress() method.This method Returns the address to which this socket is connected.Here is the code:-
Socket class getSoLinger example. public int getSoLinger() throws SocketException Returns setting for SO_LINGER. -1 returns implies that the option is disabled. The setting only affects socket close.
Socket class getSendBufferSize example. public int getSendBufferSize() throws SocketException Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket.
DatagramSocketclass GetBroadcast() method example. This example shows you how to use GetBroadcast() method.This method Tests if SO_BROADCAST is enabled.
DatagramSocketclass Connect1() method example. This example shows you how to use Connect1() method.This method Connects this socket to a remote socket address (IP address + port number).