30#ifndef HORIZON_CHAR_CHARSOCKET_HPP
31#define HORIZON_CHAR_CHARSOCKET_HPP
37#include <boost/asio/ip/tcp.hpp>
39using boost::asio::ip::tcp;
50 explicit CharSocket(uint64_t uid, std::shared_ptr<tcp::socket> socket);
54 void start()
override;
59 void set_session(std::shared_ptr<CharSession> session);
Definition: CharSocket.hpp:47
void start() override
Initial method invoked once from the network thread that handles the CharSocket.
Definition: CharSocket.cpp:60
std::shared_ptr< CharSession > _session
Definition: CharSocket.hpp:69
void set_session(std::shared_ptr< CharSession > session)
Definition: CharSocket.cpp:55
bool update() override
Asynchronous update method periodically called from network threads.
Definition: CharSocket.cpp:94
Socket< CharSocket > BaseSocket
Definition: CharSocket.hpp:48
CharSocket(uint64_t uid, std::shared_ptr< tcp::socket > socket)
Definition: CharSocket.cpp:40
void on_close() override
Socket cleanup method on connection closure.
Definition: CharSocket.cpp:77
void update_session(uint32_t diff)
Definition: CharSocket.cpp:138
~CharSocket()
Definition: CharSocket.cpp:46
void read_handler() override
Incoming buffer read handler.
Definition: CharSocket.cpp:105
std::shared_ptr< CharSession > get_session()
@thread created by network thread and called from main thread / client-sockt-mgr for update().
Definition: CharSocket.cpp:54
void on_error() override
Definition: CharSocket.cpp:85
A Socket object that handles a single connection.
Definition: Socket.hpp:82
Definition: Element.hpp:7