st_asio_wrapper is an asynchronous c/s framework based on Boost.Asio, besides all benefits brought by Boost and Boost.Asio, it also contains:
Derive your own socket from server_socket_base
, you must at least re-write on_msg_handle
virtual function and handle messages in it;
Create a service_pump
object, create a server_base<your_socket>
object, call service_pump::start_service
;
Call server_socket_base::send_msg
or server_base::broadcast_msg
when you have messages need to send.
Derive your own socket from client_socket_base
, you must at least re-write the on_msg
or on_msg_handle
virtual function and handle messages in it;
Create a service_pump
object, create a multi_client_base<your_socket>
object, add some socket via multi_client_base::add_socket
, call service_pump::start_service
;
Call client_socket_base::send_msg
or multi_client_base::broadcast_msg
when you have messages need to send.
All source codes are placed in directory include
, other directories hold demos, for documents, please refer to this project https://github.com/youngwolf-project/ascs/ .
Demonstrate how to implement tcp servers, it cantains two servers, one is the simplest server (normal server), which just send characters from keyboard to all clients (from client
demo), and receive messages from all clients (from client
demo), then display them; the other is echo server, which send every received message from echo_client
demo back.
Demonstrate how to implement tcp client, it simply send characters from keyboard to normal server in echo_server
, and receive messages from normal server in echo_server
, then display them.
Used to test st_asio_wrapper
's performance (whith echo server
).
A file transfer server.
A file transfer client, use get <file name1> [file name2] [...]
to fetch files from file_server
.
Demonstrate how to implement UDP communication.
Demonstrate how to implement TCP communication with ssl.
No special limitations, just need you to compile boost successfully.
1.49 or highter.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型