1 | /* |
2 | * IXWebSocketInitResult.h |
3 | * Author: Benjamin Sergeant |
4 | * Copyright (c) 2019 Machine Zone, Inc. All rights reserved. |
5 | */ |
6 | |
7 | #pragma once |
8 | |
9 | #include "IXWebSocketHttpHeaders.h" |
10 | |
11 | namespace ix |
12 | { |
13 | struct WebSocketInitResult |
14 | { |
15 | bool success; |
16 | int http_status; |
17 | std::string errorStr; |
18 | WebSocketHttpHeaders ; |
19 | std::string uri; |
20 | std::string protocol; |
21 | |
22 | WebSocketInitResult(bool s = false, |
23 | int status = 0, |
24 | const std::string& e = std::string(), |
25 | WebSocketHttpHeaders h = WebSocketHttpHeaders(), |
26 | const std::string& u = std::string()) |
27 | { |
28 | success = s; |
29 | http_status = status; |
30 | errorStr = e; |
31 | headers = h; |
32 | uri = u; |
33 | protocol = h["Sec-WebSocket-Protocol" ]; |
34 | } |
35 | }; |
36 | } // namespace ix |
37 | |