You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
928 B

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