diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
---|---|---|
committer | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
commit | d47ee877be5d1175bdc36f2d87881ddaf875a8e9 (patch) | |
tree | 7fd20cdc1236fe6b832ae980de12afd7071ebab9 /include/tgbot/net/TgWebhookTcpServer.h | |
parent | cea20d4078f2088dea0dd589f1cc9dd7ee22461b (diff) |
Refactor http clients, fix webhook server, add more samples, change tabs to 4 spaces
Diffstat (limited to 'include/tgbot/net/TgWebhookTcpServer.h')
-rw-r--r-- | include/tgbot/net/TgWebhookTcpServer.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/tgbot/net/TgWebhookTcpServer.h b/include/tgbot/net/TgWebhookTcpServer.h index de1f3e7..ad5a5b8 100644 --- a/include/tgbot/net/TgWebhookTcpServer.h +++ b/include/tgbot/net/TgWebhookTcpServer.h @@ -34,15 +34,17 @@ namespace TgBot { class TgWebhookTcpServer : public TgWebhookServer<boost::asio::ip::tcp> { public: - TgWebhookTcpServer(std::shared_ptr<boost::asio::basic_socket_acceptor<boost::asio::ip::tcp>> acceptor, const std::string& path, EventHandler* eventHandler) = delete; - - TgWebhookTcpServer(unsigned short port, const std::string& path, const EventHandler* eventHandler) : - TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<boost::asio::ip::tcp>>(new boost::asio::ip::tcp::acceptor(_ioService, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port))), path, eventHandler) - { - } - - TgWebhookTcpServer(const std::string& path, const Bot& bot) : TgWebhookTcpServer(path, &bot.getEventHandler()) { - } + TgWebhookTcpServer(unsigned short port, const std::string& path, const EventHandler& eventHandler) + : TgWebhookServer<boost::asio::ip::tcp>(boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port), + path, eventHandler) + { + } + + TgWebhookTcpServer(unsigned short port, const Bot& bot) + : TgWebhookServer<boost::asio::ip::tcp>(boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port), + bot) + { + } }; } |