Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SocketException.ErrorCode Property

Gets the error code that is associated with this exception.

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

public override int ErrorCode { get; }

Property Value

Type: System.Int32
An integer error code that is associated with this exception.

The ErrorCode property contains the error code that is 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 Sockets version 2 API error code documentation in MSDN.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show:
© 2015 Microsoft