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
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Troubleshooting Exceptions: System.Net.Sockets.SocketException

A SocketException exception is thrown by the Socket and Dns classes when an error occurs with the network.

Check the Errorcode property to determine why the socket error occurred.

The default constructor for the SocketException class sets the ErrorCode property to the last operating-system socket error that occurred. For more information, see the Windows Sockets Sample List.

Community Additions

© 2015 Microsoft