summaryrefslogtreecommitdiff
path: root/include/tgbot/net/TgWebhookTcpServer.h
blob: c812abe5dbb784dcab7c69d009703cdbf22eb3d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef TGBOT_TGWEBHOOKTCPSERVER_H
#define TGBOT_TGWEBHOOKTCPSERVER_H

#include "tgbot/net/TgWebhookServer.h"

#include <string>

namespace TgBot {

/**
 * This class setups HTTP server for receiving Telegram Update objects from tcp connections.
 * @ingroup net
 */
class TgWebhookTcpServer : public TgWebhookServer<boost::asio::ip::tcp> {

public:
    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)
    {
    }
};

}

#endif //TGBOT_TGWEBHOOKTCPSERVER_H