Java.Net.DatagramSocket Members

The members of Java.Net.DatagramSocket are listed below.

See Also: Inherited members from Java.Lang.Object

Public Constructors

Constructs a UDP datagram socket which is bound to any available port on the localhost.
Constructs a new DatagramSocket bound to the host/port specified by the SocketAddresslocalAddr or an unbound DatagramSocket if the SocketAddress is null.
Constructs a UDP datagram socket which is bound to the specific port aPort on the localhost.
Constructs a UDP datagram socket which is bound to the specific local address addr on port aPort.

Protected Constructors

Constructs a new DatagramSocket using the specific datagram socket implementation socketImpl.
A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

Broadcastbool. Gets the state of the socket option SocketOptions.SO_BROADCAST.
[read-only]
ChannelJava.Nio.Channels.DatagramChannel. Returns this socket's DatagramChannel, if one exists.
[read-only]
InetAddressInetAddress. Gets the InetAddress instance representing the remote address to which this UDP datagram socket is connected.
[read-only]
IsBoundbool. Returns true if this socket is bound to a local address.
[read-only]
IsClosedbool. Gets the state of this socket.
[read-only]
IsConnectedbool. Returns true if this datagram socket is connected to a remote address.
[read-only]
LocalAddressInetAddress. Returns the local address to which this socket is bound, a wildcard address if this socket is not yet bound, or null if this socket is closed.
[read-only]
LocalPortint. Gets the local port which this socket is bound to.
[read-only]
LocalSocketAddressSocketAddress. Returns the SocketAddress this socket is bound to, or null for an unbound or closed socket.
[read-only]
Portint. Gets the remote port which this socket is connected to.
ReceiveBufferSizeint. Returns this socket's SocketOptions.SoRcvbuf.
[read-only]
RemoteSocketAddressSocketAddress. Returns the SocketAddress this socket is connected to, or null for an unconnected socket.
ReuseAddressbool. Gets the state of the socket option SocketOptions.SO_REUSEADDR.
SendBufferSizeint. Returns this socket's SocketOptions.SoSndbuf.
SoTimeoutint. Gets the socket SocketOptions.SoTimeout.
TrafficClassint. Returns this socket's setting.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Bind(SocketAddress)
Binds this socket to the local address and port specified by localAddr.
Close()
Closes this UDP datagram socket and all possibly associated channels.
Connect(SocketAddress)
Connects this datagram socket to the address and port specified by peer.
Connect(InetAddress, int)
Connects this datagram socket to the specific address and port.
ConnectAsync(SocketAddress) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
ConnectAsync(InetAddress, int) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
Disconnect()
Disconnects this UDP datagram socket from the remote host.
Receive(DatagramPacket)
Receives a packet from this socket and stores it in the argument pack.
ReceiveAsync(DatagramPacket) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
Send(DatagramPacket)
Sends a packet over this socket.
SendAsync(DatagramPacket) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
static
SetDatagramSocketImplFactory(IDatagramSocketImplFactory)
Sets the socket implementation factory.