23class ProtoWriteBuffer;
96 if (how == SHUT_RDWR) {
116 std::unique_ptr<uint8_t[]>
data;
136 template<
typename StateEnum>
138 const std::string &info, StateEnum &
state, StateEnum failed_state);
APIError handle_socket_read_result_(ssize_t received)
APIFrameHelper(std::unique_ptr< socket::Socket > socket, const ClientInfo *client_info)
virtual uint8_t frame_footer_size()=0
std::vector< uint8_t > rx_buf_
APIError write_raw_(const struct iovec *iov, int iovcnt, socket::Socket *socket, std::vector< uint8_t > &tx_buf, const std::string &info, StateEnum &state, StateEnum failed_state)
virtual APIError read_packet(ReadPacketBuffer *buffer)=0
std::unique_ptr< socket::Socket > socket_owned_
bool is_socket_ready() const
void buffer_data_from_iov_(const struct iovec *iov, int iovcnt, uint16_t total_write_len, uint16_t offset)
int getpeername(struct sockaddr *addr, socklen_t *addrlen)
APIError shutdown(int how)
std::vector< struct iovec > reusable_iovs_
std::string getpeername()
APIError handle_socket_write_error_()
uint8_t frame_header_padding_
virtual APIError init()=0
const ClientInfo * client_info_
APIError try_send_tx_buf_()
virtual APIError write_protobuf_packets(ProtoWriteBuffer buffer, std::span< const PacketInfo > packets)=0
uint8_t frame_footer_size_
virtual APIError write_protobuf_packet(uint8_t type, ProtoWriteBuffer buffer)=0
APIError write_raw_(const struct iovec *iov, int iovcnt, uint16_t total_write_len)
virtual uint8_t frame_header_padding()=0
bool can_write_without_blocking()
std::deque< SendBuffer > tx_buf_
virtual ~APIFrameHelper()=default
bool ready() const
Check if socket has data ready to read For loop-monitored sockets, checks with the Application's sele...
virtual int shutdown(int how)=0
virtual int getpeername(struct sockaddr *addr, socklen_t *addrlen)=0
@ HANDSHAKESTATE_READ_FAILED
@ HANDSHAKESTATE_BAD_STATE
@ HANDSHAKESTATE_SPLIT_FAILED
@ BAD_HANDSHAKE_PACKET_LEN
@ BAD_HANDSHAKE_ERROR_BYTE
@ HANDSHAKESTATE_SETUP_FAILED
@ CIPHERSTATE_ENCRYPT_FAILED
@ CIPHERSTATE_DECRYPT_FAILED
@ HANDSHAKESTATE_WRITE_FAILED
const char * api_error_to_str(APIError err)
uint16_t remaining() const
const uint8_t * current_data() const
std::unique_ptr< uint8_t[]> data
PacketInfo(uint8_t type, uint16_t off, uint16_t size)
std::vector< uint8_t > container