12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef _DNS_DNSTLSSOCKETFACTORY_H
- #define _DNS_DNSTLSSOCKETFACTORY_H
- #include <memory>
- #include "DnsTlsSocket.h"
- #include "IDnsTlsSocketFactory.h"
- namespace android {
- namespace net {
- class IDnsTlsSocketObserver;
- class DnsTlsSessionCache;
- struct DnsTlsServer;
- class DnsTlsSocketFactory : public IDnsTlsSocketFactory {
- public:
- std::unique_ptr<IDnsTlsSocket> createDnsTlsSocket(const DnsTlsServer& server, unsigned mark,
- IDnsTlsSocketObserver* _Nonnull observer,
- DnsTlsSessionCache* _Nonnull cache) override {
- auto socket = std::make_unique<DnsTlsSocket>(server, mark, observer, cache);
- if (!socket->initialize()) {
- return nullptr;
- }
- return std::move(socket);
- }
- };
- }
- }
- #endif
|