DatagramSocket.Close DatagramSocket.Close DatagramSocket.Close DatagramSocket.Close DatagramSocket.Close Method

Definition

Closes the DatagramSocket object and aborts any pending operation on the DatagramSocket.

public : void Close()
void Close() const;
// This member is not implemented in C#
' This member is not implemented in VB.Net
// This member is not implemented in JavaScript

Additional features and requirements

Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The Close method aborts any pending operations and releases all unmanaged resources associated with the DatagramSocket object.

Calling the Close method on the DatagramSocket also unregisters the MessageReceived event.

The Close method is used by Windows apps using JavaScript. For apps written using the .NET Framework 4.5 in C# and VB.NET, the Close method is exposed as the Dispose method on the DatagramSocket. For apps written in C++, the Close method is called when the object's destructor runs.

See also