10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
UnixSocket.h
1#if defined(__APPLE__) || defined(__linux__) || defined(__unix__) || defined(_POSIX_VERSION) || defined(__ANDROID__)
2
3#ifndef TENDUKE_OSA_UNX_UNIXSOCKET_H
4#define TENDUKE_OSA_UNX_UNIXSOCKET_H
5
6#include "../AbstractBaseSocket.h"
7
8namespace tenduke { namespace osa { namespace unx {
9
10class UnixSocket : public ::tenduke::osa::AbstractBaseSocket<int>
11{
12public:
13 ~UnixSocket() override;
14
19 UnixSocket();
20
24 explicit UnixSocket(int descriptor);
25
26 // ::tenduke::osa:Socket implementation
27
31 std::unique_ptr<Socket> accept() override;
32 using ::tenduke::osa::AbstractBaseSocket<int>::accept;
33
37 void bind(std::uint32_t ipAddress, std::uint16_t port) override;
38
42 std::uint16_t getPort() const override;
43
47 void setNonBlocking() override;
48
49protected:
53 bool hasIncomingConnections(std::uint32_t timeoutMs) const override;
54
58 int getLastError() const override;
59
63 std::string mkErrorMessage(const std::string &body, int errorCode) const override;
64
68 bool wouldBlock(int errorCode) const override;
69};
70
71}}}
72
73#endif //TENDUKE_OSA_UNX_UNIXSOCKET_H
74
75#endif // OS-detection
Operating system abstraction.
Definition win32_utils.h:7
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4