10Duke Scale C++ Client
Loading...
Searching...
No Matches
WindowsSocket.h
1#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined (_WIN64)
2
3#ifndef TENDUKE_OSA_WIN_WINDOWSSOCKET_H
4#define TENDUKE_OSA_WIN_WINDOWSSOCKET_H
5
6#include "../AbstractBaseSocket.h"
7
8namespace tenduke { namespace osa { namespace win {
9
10
14class WindowsSocket : public tenduke::osa::AbstractBaseSocket
15{
16public:
21 WindowsSocket(u_long address, u_short port);
22
23 std::unique_ptr<tenduke::osa::Socket> accept() override;
24 std::uint16_t getPort() const override;
25 void setNonBlocking() override;
26
27protected:
28 WindowsSocket(::SOCKET descriptor, const struct ::sockaddr_in *address);
29
30 std::unique_ptr<tenduke::osa::Socket> createSocket(int descriptor, const struct ::sockaddr_in *address) override;
31 int getLastError() const override;
32 std::string mkErrorMessage(const std::string &body, int errorCode) const override;
33 bool wouldBlock(int errorCode) const override;
34
35 // https://isocpp.org/wiki/faq/strange-inheritance#hiding-rule
36 // tenduke::osa::AbstractBaseSocketInterface
37protected:
39};
40
41}}}
42
43#endif //TENDUKE_OSA_WIN_WINDOWSSOCKET_H
44
45#endif // Windows
Abstract base implementation of tenduke::osa::Socket.
Definition AbstractBaseSocket.h:52
virtual std::string mkErrorMessage(const std::string &body) const
Builds error message.
Definition AbstractBaseSocket.cpp:138
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7