25#ifndef QB_IO_ASYNC_PROTOCOL_HANDSHAKE_H
26#define QB_IO_ASYNC_PROTOCOL_HANDSHAKE_H
30namespace qb::io::protocol {
40template <
typename _IO_>
42 bool _handshake_done =
false;
48 using message = qb::io::async::event::handshake;
78 return static_cast<size_t>(this->
_io.transport().do_handshake());
92 _handshake_done =
true;
103 _handshake_done =
false;
Handshake event for asynchronous input streams.
Abstract base class for I/O-component-aware protocols (CRTP).
Definition protocol.h:146
_IO_ & _io
Reference to the I/O component instance that this protocol is associated with.
Definition protocol.h:166
void set_should_flush(bool should_flush) noexcept
Sets the flag indicating whether the protocol should flush the input buffer after processing a messag...
Definition protocol.h:117
handshake(_IO_ &io) noexcept
Constructor with I/O reference.
Definition handshake.h:59
handshake()=delete
Default constructor is deleted as an I/O component reference is required.
qb::io::async::event::handshake message
Type alias for the handshake event.
Definition handshake.h:48
void onMessage(std::size_t) noexcept final
Triggers the handshake event.
Definition handshake.h:91
std::size_t getMessageSize() noexcept final
Checks if the handshake is done.
Definition handshake.h:75
void reset() noexcept final
Resets the protocol state.
Definition handshake.h:102
Protocol interfaces for message processing in the asynchronous IO framework.