StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
Loading...
Searching...
No Matches
handler.hxx
1#pragma once
2
3#include <StormByte/network/visibility.h>
4
5#ifdef WINDOWS
6#include <winsock2.h>
7#endif
8
9#include <string>
10
15namespace StormByte::Network::Connection {
16 class STORMBYTE_NETWORK_PUBLIC Handler {
17 public:
18 #ifdef LINUX
19 using Type = int;
20 #else
21 using Type = SOCKET;
22 #endif
23
28
33 Handler(const Handler& other) = delete;
34
39 Handler(Handler&& other) noexcept = delete;
40
44 ~Handler() noexcept;
45
51 Handler& operator=(const Handler& other) = delete;
52
58 Handler& operator=(Handler&& other) noexcept = delete;
59
64 std::string LastError() const noexcept;
65
70 int LastErrorCode() const noexcept;
71
72 private:
73 bool m_initialized = false;
74 #ifdef WINDOWS
75 WSADATA m_wsaData;
76 #endif
77 };
78}
SOCKET Type
The type of the socket.
Definition handler.hxx:21
~Handler() noexcept
The destructor of the Handler class.
Handler(const Handler &other)=delete
The copy constructor of the Handler class.
Handler()
The constructor of the Handler class.
Handler(Handler &&other) noexcept=delete
The move constructor of the Handler class.