io_channel Class¶
负责管理 TCP/SSL/UDP/KCP 连接和传输会话。
语法¶
namespace yasio { namespace inet { class io_channel; } }
成员¶
公共方法¶
Name | Description |
---|---|
io_channel::get_service | 获取管理信道的io_service |
io_channel::index | 获取信道索引 |
io_channel::remote_port | 获取信道远程端口 |
注意¶
当io_service对象构造后,最大信道数量不可改变,
信道句柄可通过 io_service::channel_at
获取。
io_channel::get_service¶
获取管理信道的io_service对象。
io_service& get_service()
io_channel::index¶
获取信道索引。
int index() const
io_channel::remote_port¶
获取信道远程端口.
u_short remote_port() const;
返回值¶
返回信道远程端口号
- 对于客户端信道表示通信的远端端口
- 对于服务端信道表示监听端口