19 #ifndef IRCCD_DAEMON_TRANSPORT_CLIENT_HPP
20 #define IRCCD_DAEMON_TRANSPORT_CLIENT_HPP
27 #include <irccd/sysconfig.hpp>
31 #include <string_view>
33 #include <irccd/stream.hpp>
37 class transport_server;
63 std::weak_ptr<transport_server> parent_;
64 std::shared_ptr<stream> stream_;
65 std::deque<std::pair<nlohmann::json, stream::send_handler>> queue_;
80 std::shared_ptr<stream>
stream) noexcept;
131 void write(nlohmann::json json,
stream::send_handler handler =
nullptr);
161 void error(
std::error_code code,
std::string_view command,
stream::send_handler handler =
nullptr);
The class that connect to a IRC server.
Definition: server.hpp:256
Abstract transport client class.
Definition: transport_client.hpp:45
void write(nlohmann::json json, stream::send_handler handler=nullptr)
void success(const std::string &command, stream::send_handler handler=nullptr)
state
Definition: transport_client.hpp:55
@ closing
client is closing
@ authenticating
client is authenticating
void set_state(state state) noexcept
transport_client(std::weak_ptr< transport_server > server, std::shared_ptr< stream > stream) noexcept
std::function< void(std::error_code)> handshake_handler
Definition: transport_client.hpp:50
void error(std::error_code code, stream::send_handler handler=nullptr)
auto get_state() const noexcept -> state
void read(stream::recv_handler handler)
void handshake(handshake_handler)
Abstract stream interface.
Definition: stream.hpp:58
Main irccd namespace.
Definition: bot.hpp:41