DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
WebSocketException.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "Common.h"
7#include "System/String.h"
9
10namespace DotNetDupe {
11 namespace System {
12 namespace Net {
13 namespace WebSockets {
14
29
38 private:
39 WebSocketError m_eWebSocketErrorCode;
40 int m_iNativeErrorCode;
41
42 public:
45 DOTNETDUPE_API explicit WebSocketException(const String& sMessage);
46
51
56 DOTNETDUPE_API WebSocketException(WebSocketError eError, int iNativeErrorCode, const String& sMessage);
57
61 DOTNETDUPE_API WebSocketException(WebSocketError eError, const Exception& innerException);
62
67 DOTNETDUPE_API WebSocketException(WebSocketError eError, const String& sMessage, const Exception& innerException);
68
72
75 DOTNETDUPE_API int GetErrorCode() const;
76 };
77
78 }
79 }
80 }
81}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Serves as the base class for system exceptions across the library.
Exception()
Initializes a new instance of the Exception class with a default system-supplied message.
Definition Exception.cpp:15
WebSocketException(const String &sMessage)
Constructs a WebSocketException with a custom descriptive error message.
WebSocketError GetWebSocketErrorCode() const
Gets the structured WebSocketError enumeration code.
int GetErrorCode() const
Gets the native operating system error code associated with this exception.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
SystemException()
Initializes a new instance of the SystemException class with a default message.
Definition Exception.cpp:48
WebSocketError
Categorizes errors that occur during WebSocket protocol handshakes, framing, or socket I/O.
@ InvalidMessageType
Received frame has an unknown or unexpected opcode.
@ UnsupportedVersion
Requested Sec-WebSocket-Version is not supported.
@ Faulted
General fault occurred during processing.
@ UnsupportedProtocol
Requested subprotocol is not supported.
@ NativeError
Underlying socket or OS network error.
@ HeaderError
Malformed WebSocket frame header or HTTP upgrade header.
@ NotAWebSocket
The connection or payload does not conform to RFC 6455.
@ ConnectionClosedPrematurely
Connection closed before frame payload was completely read.
@ InvalidState
Attempted operation on an inactive, closed, or aborted socket.