<commit_before>/*!
    \file tcp_server.inl
    \brief TCP server inline implementation
    \author <NAME>
    \date 14.12.2016
    \copyright MIT License
*/

namespace CppServer {
namespace Asio {

template <class TServer, class TSession>
inline TCPServer<TServer, TSession>::TCPServer(Service& service, InternetProtocol protocol, int port)
    : _service(service),
      _acceptor(_service.service()),
      _socket(_service.service())
{
    // Create TCP endpoint
    asio::ip::tcp::endpoint endpoint;
    switch (protocol)
    {
        case InternetProtocol::IPv4:
            endpoint = asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port);
            break;
        case InternetProtocol::IPv6:
            endpoint = asio::ip::tcp::endpoint(asio::ip::tcp::v6(), port);
            break;
    }

    // Create TCP acceptor
    _acceptor = asio::ip::tcp::acceptor(_service.service(), endpoint);
}

template <class TServer, class TSession>
inline TCPServer<TServer, TSession>::TCPServer(Service& service, const std::string& address, int port)
    : _service(service.service()),
      _acceptor(_service),
      _socket(_service)
{
    // Create TCP endpoint
    asio::ip::tcp::endpoint endpoint = asio::ip::tcp::endpoint(asio::ip::address::from_string(address), port);

    // Create TCP acceptor
    _acceptor = asio::ip::tcp::acceptor(_service.service(), endpoint);
}
<commit_msg>build<commit_after>/*!
    \file tcp_server.inl
    \brief TCP server inline implementation
    \author <NAME>
    \date 14.12.2016
    \copyright MIT License
*/

namespace CppServer {
namespace Asio {

template <class TServer, class TSession>
inline TCPServer<TServer, TSession>::TCPServer(Service& service, InternetProtocol protocol, int port)
    : _service(service),
      _acceptor(_service.service()),
      _socket(_service.service())
{
    // Create TCP endpoint
    asio::ip::tcp::endpoint endpoint;
    switch (protocol)
    {
        case InternetProtocol::IPv4:
            endpoint = asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port);
            break;
        case InternetProtocol::IPv6:
            endpoint = asio::ip::tcp::endpoint(asio::ip::tcp::v6(), port);
            break;
    }

    // Create TCP acceptor
    _acceptor = asio::ip::tcp::acceptor(_service.service(), endpoint);
}

template <class TServer, class TSession>
inline TCPServer<TServer, TSession>::TCPServer(Service& service, const std::string& address, int port)
    : _service(service),
      _acceptor(_service.service()),
      _socket(_service.service())
{
    // Create TCP endpoint
    asio::ip::tcp::endpoint endpoint = asio::ip::tcp::endpoint(asio::ip::address::from_string(address), port);

    // Create TCP acceptor
    _acceptor = asio::ip::tcp::acceptor(_service.service(), endpoint);
}

{'fraction_non_alphanumeric': 0.14383561643835616, 'fraction_numerical': 0.008651766402307137, 'mean_word_length': 3.640468227424749, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2536186', 'n_tokens_mistral': 837, 'n_tokens_neox': 814, 'n_words': 180}