aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Server/TCPServerConnectionFactory.h
blob: 18b30557b00014fe78aa75ef0080f6932fa232f5 (plain) (blame)
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
#pragma once

#include <Poco/SharedPtr.h>
#include <Server/TCPProtocolStackData.h>

namespace Poco
{
namespace Net
{
    class StreamSocket;
    class TCPServerConnection;
}
}
namespace DB
{
class TCPServer;

class TCPServerConnectionFactory
{
public:
    using Ptr = Poco::SharedPtr<TCPServerConnectionFactory>;

    virtual ~TCPServerConnectionFactory() = default;

    /// Same as Poco::Net::TCPServerConnectionFactory except we can pass the TCPServer
    virtual Poco::Net::TCPServerConnection * createConnection(const Poco::Net::StreamSocket & socket, TCPServer & tcp_server) = 0;
    virtual Poco::Net::TCPServerConnection * createConnection(const Poco::Net::StreamSocket & socket, TCPServer & tcp_server, TCPProtocolStackData &/* stack_data */)
    {
        return createConnection(socket, tcp_server);
    }
};
}