Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
sese::service::TcpTransporter类 参考abstract

TCP 传输器 更多...

#include <TcpTransporter.h>

类 sese::service::TcpTransporter 继承关系图:
sese::service::v1::TimerableService

Public 成员函数

 TcpTransporter (TcpTransporterConfig *transporter_config) noexcept
 
 ~TcpTransporter () override
 
- Public 成员函数 继承自 sese::service::v1::TimerableService
 ~TimerableService () override
 
bool init () override
 
void dispatch (uint32_t timeout) override
 
TimeoutEventcreateTimeoutEvent (int fd, void *data, uint64_t seconds)
 
void setTimeoutEvent (TimeoutEvent *timeout_event, uint64_t seconds)
 
TimeoutEventgetTimeoutEventByFd (int fd)
 
void cancelTimeoutEvent (TimeoutEvent *timeout_event)
 
void freeTimeoutEvent (TimeoutEvent *timeout_event)
 

Protected 成员函数

void onAccept (int fd) override
 
void onRead (event::BaseEvent *event) override
 
void onWrite (event::BaseEvent *event) override
 
void onClose (event::BaseEvent *event) override
 
void onTimeout (v1::TimeoutEvent *timeout_event) override
 
virtual void postRead (TcpConnection *conn)
 
virtual void postWrite (TcpConnection *conn)
 
virtual int onProcAlpnSelect (const uint8_t **out, uint8_t *out_length, const uint8_t *in, uint32_t in_length)=0
 
virtual void onProcAlpnGet (TcpConnection *conn, const uint8_t *in, uint32_t in_length)=0
 
virtual void onProcHandle (TcpConnection *conn)=0
 
virtual void onProcClose (TcpConnection *conn)=0
 
event::BaseEventcreateEventEx (int fd, unsigned int events, TcpConnection *conn) noexcept
 
void freeEventEx (event::BaseEvent *event) noexcept
 

静态 Protected 成员函数

static int64_t read (int fd, void *buffer, size_t len, void *ssl) noexcept
 
static int64_t write (int fd, const void *buffer, size_t len, void *ssl) noexcept
 

Protected 属性

TcpTransporterConfigconfig = nullptr
 
std::map< int, event::BaseEvent * > eventMap
 

静态 Private 成员函数

static int alpnCallbackFunction (void *ssl, const uint8_t **out, uint8_t *out_length, const uint8_t *in, uint32_t in_length, TcpTransporter *transporter)
 

详细描述

TCP 传输器

构造及析构函数说明

◆ TcpTransporter()

sese::service::TcpTransporter::TcpTransporter ( TcpTransporterConfig * transporter_config)
explicitnoexcept

◆ ~TcpTransporter()

sese::service::TcpTransporter::~TcpTransporter ( )
override

成员函数说明

◆ alpnCallbackFunction()

int sese::service::TcpTransporter::alpnCallbackFunction ( void * ssl,
const uint8_t ** out,
uint8_t * out_length,
const uint8_t * in,
uint32_t in_length,
TcpTransporter * transporter )
staticprivate

引用了 in() , 以及 onProcAlpnSelect().

◆ createEventEx()

sese::event::BaseEvent * sese::service::TcpTransporter::createEventEx ( int fd,
unsigned int events,
TcpConnection * conn )
protectednoexcept

◆ freeEventEx()

void sese::service::TcpTransporter::freeEventEx ( event::BaseEvent * event)
protectednoexcept

◆ onAccept()

void sese::service::TcpTransporter::onAccept ( int fd)
overrideprotected

◆ onClose()

void sese::service::TcpTransporter::onClose ( event::BaseEvent * event)
overrideprotected

若连接进行异步处理,则不应由对端关闭事件对此连接进行资源释放

参见
tcp_connection_delay_close_by_async

引用了 sese::net::Socket::close() , 以及 sese::event::BaseEvent::fd.

◆ onProcAlpnGet()

virtual void sese::service::TcpTransporter::onProcAlpnGet ( TcpConnection * conn,
const uint8_t * in,
uint32_t in_length )
protectedpure virtual

◆ onProcAlpnSelect()

virtual int sese::service::TcpTransporter::onProcAlpnSelect ( const uint8_t ** out,
uint8_t * out_length,
const uint8_t * in,
uint32_t in_length )
protectedpure virtual

被这些函数引用 alpnCallbackFunction().

◆ onProcClose()

virtual void sese::service::TcpTransporter::onProcClose ( TcpConnection * conn)
protectedpure virtual

◆ onProcHandle()

virtual void sese::service::TcpTransporter::onProcHandle ( TcpConnection * conn)
protectedpure virtual

◆ onRead()

void sese::service::TcpTransporter::onRead ( event::BaseEvent * event)
overrideprotected

◆ onTimeout()

void sese::service::TcpTransporter::onTimeout ( v1::TimeoutEvent * timeout_event)
overrideprotectedvirtual

当超时事件发生时触发

参数
timeout_event

重载 sese::service::v1::TimerableService .

引用了 sese::net::Socket::close() , 以及 sese::service::v1::TimeoutEvent::data.

◆ onWrite()

◆ postRead()

void sese::service::TcpTransporter::postRead ( TcpConnection * conn)
protectedvirtual

◆ postWrite()

void sese::service::TcpTransporter::postWrite ( TcpConnection * conn)
protectedvirtual

◆ read()

int64_t sese::service::TcpTransporter::read ( int fd,
void * buffer,
size_t len,
void * ssl )
staticprotectednoexcept

◆ write()

int64_t sese::service::TcpTransporter::write ( int fd,
const void * buffer,
size_t len,
void * ssl )
staticprotectednoexcept

类成员变量说明

◆ config

TcpTransporterConfig* sese::service::TcpTransporter::config = nullptr
protected

◆ eventMap

std::map<int, event::BaseEvent *> sese::service::TcpTransporter::eventMap
protected

该类的文档由以下文件生成: