• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PANDA_TOOLING_INSPECTOR_ASIO_CONFIG_H
17 #define PANDA_TOOLING_INSPECTOR_ASIO_CONFIG_H
18 
19 #include "ws_logger.h"
20 
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wshadow"
23 #include "websocketpp/config/asio_no_tls.hpp"
24 #include "websocketpp/logger/levels.hpp"
25 #include "websocketpp/transport/asio/endpoint.hpp"
26 #pragma GCC diagnostic pop
27 
28 namespace panda::tooling::inspector {
29 struct AsioConfig : websocketpp::config::asio {
30     static const websocketpp::log::level alog_level = websocketpp::log::alevel::access_core;
31 
32     using alog_type = WsLogger;
33     using elog_type = WsLogger;
34 
35     struct transport_config : websocketpp::config::asio::transport_config {
36         using alog_type = AsioConfig::alog_type;
37         using elog_type = AsioConfig::elog_type;
38 
39         static const bool enable_multithreading = false;
40     };
41 
42     using transport_type = websocketpp::transport::asio::endpoint<transport_config>;
43 };
44 }  // namespace panda::tooling::inspector
45 
46 #endif  // PANDA_TOOLING_INSPECTOR_ASIO_CONFIG_H
47