This documentation is archived and is not being maintained.

SocketException.ErrorCode Property

Gets the error code associated with this exception.

[Visual Basic]
Overrides Public ReadOnly Property ErrorCode As Integer
public override int ErrorCode {get;}
public: __property int get_ErrorCode();
public override function get ErrorCode() : int;

Property Value

An integer error code associated with this exception.


The ErrorCode property contains the error code associated with the error that caused the exception.

The default constructor for SocketException sets the ErrorCode property to the last operating system error that occurred. For more information about socket error codes, see the Windows Socket Version 2 API error code documentation in MSDN.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

SocketException Class | SocketException Members | System.Net.Sockets Namespace