|
ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
|
所有传输层共享的Asio I/O上下文封装。 More...
#include "tools/tools/tools_thread.h"#include "net/node_pack.h"#include "tools/type.h"#include <boost/beast/core/flat_buffer.hpp>#include <boost/beast/core/tcp_stream.hpp>#include <boost/beast/websocket/ssl.hpp>#include <boost/beast/websocket.hpp>#include <boost/asio/ssl.hpp>#include <boost/asio.hpp>#include <unordered_map>#include <unordered_set>#include <functional>#include <variant>#include <atomic>#include <string>#include <deque>#include <set>#include <vector>Classes | |
| struct | ngl::net_listen_endpoint |
| struct | ngl::serviceio_info |
| WebSocket服务类前向声明 More... | |
| class | ngl::service_io |
| 服务IO基类。 More... | |
| class | ngl::service_tcp |
| TCP服务会话类。 More... | |
| class | ngl::service_ws |
| WebSocket服务会话类。 More... | |
Typedefs | |
| using | ngl::basio_errorcode = boost::system::error_code |
| < Boost.Asio命名空间别名 | |
| using | ngl::basio_ioservice = basio::io_context |
| IO上下文类型 | |
| using | ngl::basio_ioservicework = basio::executor_work_guard<basio_ioservice::executor_type> |
| IO工作守卫类型 | |
| using | ngl::basio_iptcpsocket = basio::ip::tcp::socket |
| TCP套接字类型 | |
| using | ngl::basio_iptcpendpoint = basio::ip::tcp::endpoint |
| TCP端点类型 | |
| using | ngl::basio_ipaddress = basio::ip::address |
| IP地址类型 | |
| using | ngl::tuple_ioservice = std::tuple<std::shared_ptr<basio_ioservice>, std::shared_ptr<basio_ioservicework>, std::shared_ptr<std::thread>> |
| IO服务元组类型 | |
| using | ngl::basio_tcpacceptor = basio::ip::tcp::acceptor |
| TCP接受器类型 | |
| using | ngl::basio_tcpstream = beast::tcp_stream |
| TCP流类型 | |
| using | ngl::basio_sslcontext = basio::ssl::context |
| SSL上下文类型 | |
| using | ngl::basio_sslstream = basio::ssl::stream<basio_tcpstream> |
| SSL流类型 | |
| using | ngl::basio_websocket = bwebsocket::stream<basio_tcpstream> |
| WebSocket流类型 | |
| using | ngl::basio_websocket_tls = bwebsocket::stream<basio_sslstream> |
| TLS WebSocket流类型 | |
所有传输层共享的Asio I/O上下文封装。
本文件定义了基于Boost.Asio的网络IO基础设施,包括:
该文件是整个网络传输层的基础,为TCP和WebSocket提供统一的IO操作接口。
| using ngl::basio_errorcode = boost::system::error_code |
< Boost.Asio命名空间别名
< Boost.Beast命名空间别名 < Boost.Beast WebSocket命名空间别名
Boost.Asio类型别名定义。
为常用的Boost.Asio类型定义简短的别名,提高代码可读性。 错误码类型