16 public override int ErrorCode => base.NativeErrorCode;
24 : this(
Marshal.GetLastWin32Error())
31 : this(error, GetErrorMessage(error))
41 m_WebSocketErrorCode = error;
48 : this(error, GetErrorMessage(error), innerException)
57 : base(message, innerException)
59 m_WebSocketErrorCode = error;
68 SetErrorCodeOnError(nativeError);
75 : base(nativeError, message)
78 SetErrorCodeOnError(nativeError);
85 : base(SR.GetString(
"net_WebSockets_Generic"), innerException)
88 SetErrorCodeOnError(nativeError);
95 : this(error, nativeError, GetErrorMessage(error))
106 m_WebSocketErrorCode = error;
107 SetErrorCodeOnError(nativeError);
115 : this(error, nativeError, GetErrorMessage(error), innerException)
125 : base(message, innerException)
127 m_WebSocketErrorCode = error;
128 SetErrorCodeOnError(nativeError);
142 : base(message, innerException)
147 : base(serializationInfo, streamingContext)
156 return SR.GetString(
"net_WebSockets_InvalidMessageType_Generic", typeof(WebSocket).Name +
"CloseAsync", typeof(WebSocket).Name +
"CloseOutputAsync");
158 return SR.GetString(
"net_Websockets_WebSocketBaseFaulted");
160 return SR.GetString(
"net_WebSockets_NotAWebSocket_Generic");
162 return SR.GetString(
"net_WebSockets_UnsupportedWebSocketVersion_Generic");
164 return SR.GetString(
"net_WebSockets_UnsupportedProtocol_Generic");
166 return SR.GetString(
"net_WebSockets_HeaderError_Generic");
168 return SR.GetString(
"net_WebSockets_ConnectionClosedPrematurely_Generic");
170 return SR.GetString(
"net_WebSockets_InvalidState_Generic");
172 return SR.GetString(
"net_WebSockets_Generic");
186 info.AddValue(
"WebSocketErrorCode", m_WebSocketErrorCode);
187 base.GetObjectData(info, context);
190 private void SetErrorCodeOnError(
int nativeError)
192 if (!WebSocketProtocolComponent.Succeeded(nativeError))
194 base.HResult = nativeError;
WebSocketException(int nativeError, string message)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the SerializationInfo object with the file name and line number where the exception occurred.
override int ErrorCode
The native error code for the exception that occurred.
WebSocketException(string message, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error, string message, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error, int nativeError)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
WebSocketError WebSocketErrorCode
Returns a WebSocketError indicating the type of error that occurred.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Throws an exception for a Win32 error code.
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks,...
WebSocketException(int nativeError)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
WebSocketException(string message)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException()
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error, int nativeError, string message)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
Represents an exception that occurred when performing an operation on a WebSocket connection.
WebSocketError
Contains the list of possible WebSocket errors.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
WebSocketException(WebSocketError error, int nativeError, string message, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(int nativeError, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error, int nativeError, Exception innerException)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
Specifies that the class can be serialized.
WebSocketException(WebSocketError error, string message)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.
WebSocketException(WebSocketError error)
Creates an instance of the T:System.Net.WebSockets.WebSocketException class.