AsyncFw 1.2
Async Framework is c++ runtime with timers, poll notifiers, sockets, coroutines, etc.
 
Loading...
Searching...
No Matches
AbstractTlsSocket.h
1/*
2Copyright (c) 2026 Alexandr Kuzmuk
3
4This file is part of the AsyncFw project. Licensed under the MIT License.
5See {Link: LICENSE file https://mit-license.org} in the project root for full license information.
6*/
7
8#pragma once
9
10#include "AbstractSocket.h"
11
12namespace AsyncFw {
13class TlsContext;
14
17class AbstractTlsSocket : public AbstractSocket {
18 friend LogStream &operator<<(LogStream &, const AbstractTlsSocket &);
19 struct Private;
20
21public:
22 enum IgnoreErrors : uint8_t { TimeValidity = 0x01 };
23
24 void setDescriptor(int) override;
25 bool connect(const std::string &, uint16_t) override;
26 void disconnect() override;
27 void close() override;
28
29 void setContext(const TlsContext &) const;
30
31protected:
32 AbstractTlsSocket();
33 ~AbstractTlsSocket() override;
34
35 virtual void activateReady();
36
37 void activateEvent() override;
38
39 int read_available_fd() const override final;
40 int read_fd(void *_p, int _s) override final;
41 int write_fd(const void *_p, int _s) override final;
42
43private:
44 Private *private_;
45};
46} // namespace AsyncFw
The LogStream class.
Definition LogStream.h:44
The TlsContext class provides functionality for managing TLS certificates.
Definition TlsContext.h:24