io_channel Class¶
Provides the functionality of establishing tcp/udp/kcp connections.
Syntax¶
namespace yasio { namespace inet { class io_channel; } }
Public Methods¶
Name | Description |
---|---|
io_channel::get_service | Gets belong service of channel. |
io_channel::index | Gets index of channel at service. |
io_channel::remote_port | Gets remote port of channel. |
Remarks¶
Once io_service initialized, the max count of channel can't be changed.
Retrieves through io_service::channel_at
.
io_channel::get_service¶
Gets owner service.
io_service& get_service()
io_channel::index¶
Gets channel index at service.
int index() const
io_channel::remote_port¶
Gets remote port.
u_short remote_port() const;
Return value¶
Return remote port of channel
- For client channel, it's port to connect.
- For server channel, it's port to listen.