DatagramSocketInformation DatagramSocketInformation DatagramSocketInformation DatagramSocketInformation Class

Definition

Provides socket information on a DatagramSocket object.

public sealed class DatagramSocketInformationpublic sealed class DatagramSocketInformationPublic NotInheritable Class DatagramSocketInformationpublic sealed class DatagramSocketInformation
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The DatagramSocketInformation class provides information about a DatagramSocket. This class retrieves information on a DatagramSocket and can be called any time after the DatagramSocket has been created.

A DatagramSocketInformation object is automatically created with the parent DatagramSocket object . The Information property provides access to the associated DatagramSocketInformation object.

Properties

LocalAddress LocalAddress LocalAddress LocalAddress

The local IP address associated with a DatagramSocket object.

public HostName LocalAddress { get; }public HostName LocalAddress { get; }Public ReadOnly Property LocalAddress As HostNamepublic HostName LocalAddress { get; }
Value
HostName HostName HostName HostName

The local hostname or IP address.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The LocalAddress property represents the local IP address bound to the DatagramSocket object.

An app can set the local hostname or IP address to use by calling the BindEndpointAsync(HostName, String) , ConnectAsync(EndpointPair) , or GetOutputStreamAsync(EndpointPair) methods on the DatagramSocket. The bind or connect operation will bind the socket to the specific local IP address and local UDP port number. After the bind or connect operation completes, LocalAddress property contains the IP address and the LocalPort property contains the local UDP port number that the local hostname and service name resolved to.

If the local hostname or IP address passed to the BindEndpointAsync(HostName, String) , BindServiceNameAsync(String, NetworkAdapter), ConnectAsync(EndpointPair) , or GetOutputStreamAsync(EndpointPair) methods is null or the ConnectAsync(HostName, String) or GetOutputStreamAsync(HostName, String) method is called, the system will determine the local IP address to bind to the DatagramSocket object.

LocalPort LocalPort LocalPort LocalPort

The local service name or UDP port number associated with a DatagramSocket.

public string LocalPort { get; }public string LocalPort { get; }Public ReadOnly Property LocalPort As stringpublic string LocalPort { get; }
Value
string string string string

The local service name or UDP port number.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The LocalPort property represents the local service name or UDP port number bound to the DatagramSocket object.

An app can set the local service name or UDP port number to use by calling the BindEndpointAsync(HostName, String) , BindServiceNameAsync(String, NetworkAdapter), ConnectAsync(EndpointPair) , or GetOutputStreamAsync(EndpointPair) methods on the DatagramSocket. The bind or connect operation will bind the socket to the specific local IP address and local UDP port number. After the bind or connect operation completes, LocalAddress property contains the IP address and the LocalPort property contains the local UDP port number that the local hostname and service name resolved to.

If the local service name or UDP port number passed to the BindEndpointAsync(HostName, String) , BindServiceNameAsync(String, NetworkAdapter), ConnectAsync(EndpointPair) , or GetOutputStreamAsync(EndpointPair) methods is an empty string or the ConnectAsync(HostName, String) or GetOutputStreamAsync(HostName, String) method is called, the system will determine the local UDP port to bind to the DatagramSocket object.

RemoteAddress RemoteAddress RemoteAddress RemoteAddress

The IP address of the remote network destination associated with a DatagramSocket object.

public HostName RemoteAddress { get; }public HostName RemoteAddress { get; }Public ReadOnly Property RemoteAddress As HostNamepublic HostName RemoteAddress { get; }
Value
HostName HostName HostName HostName

The IP address of the remote network destination.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The RemoteAddress property represents the remote IP address for the remote network destination associated with a DatagramSocket object.

An app can set the remote hostname or IP address and remote service name or UDP port number to use by calling the ConnectAsync(EndpointPair) or GetOutputStreamAsync(HostName, String) method on the DatagramSocket. The connect operation will bind the socket to a specific remote IP address and remote UDP port number. The RemoteAddress property is the IP address that remote hostname resolved to.

RemotePort RemotePort RemotePort RemotePort

The UDP port number of the remote network destination associated with a DatagramSocket object.

public string RemotePort { get; }public string RemotePort { get; }Public ReadOnly Property RemotePort As stringpublic string RemotePort { get; }
Value
string string string string

The UDP port number of the remote network destination.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The RemotePort property represents the UDP port number for the remote network destination associated with a DatagramSocket object.

An app can set the remote hostname or IP address and remote service name or UDP port number to use by calling the ConnectAsync(EndpointPair) or GetOutputStreamAsync(HostName, String) method on the DatagramSocket. The connect operation will bind the socket to a specific remote IP address and remote UDP port number. The RemotePort property is the UDP port number the remote service name resolved to.