Share via


Socket.Dispose Method

Releases the unmanaged resources used by the current socket, and optionally releases the managed resources also.

Namespace: System.Net.Sockets
Assembly: System (in system.dll)

Syntax

protected virtual void Dispose (
         booldisposing
)

Parameters

  • disposing
    true to release both the managed and unmanaged resources used by the current socket; false to release only the unmanaged resources.

Remarks

This method is called by the public IDisposable.Dispose method and the Finalize method. The IDisposable.Dispose method invokes the protected Socket.Dispose method with the disposing parameter set to true. The Finalize method invokes Socket.Dispose with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that the current Socket object references. This method invokes the IDisposable.Dispose method of each referenced object.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Socket Class
Socket Members
System.Net.Sockets Namespace