3

我正在调试一些使用 websocketpp 的外国代码。我不断得到相当冗长的控制台输出,尽管一切正常。我可以禁用输出还是至少指向特定的东西?BR,丹尼尔

[2014-07-08 14:51:27] [fatal] error in handle_read_handshake: End of File
[2014-07-08 14:51:27] [fatal] error in handle_read_frame: End of File (websocketpp.transport:7)
[2014-07-08 14:51:27] [info] asio async_shutdown error: system:10054 (An existing connection was forcibly closed by the remote host)
[2014-07-08 14:51:27] [error] Underlying Transport Error
[2014-07-08 14:51:27] [fatal] error in handle_read_frame: End of File (websocketpp.transport:7)
[2014-07-08 14:51:27] [info] asio async_write error: system:10053 (An established connection was aborted by the software in your host machine)
[2014-07-08 14:51:27] [fatal] error in handle_write_frame: Underlying TransportError
[2014-07-08 14:51:35] [fatal] error in handle_read_frame: End of File (websocketpp.transport:7)
[2014-07-08 14:51:35] [info] asio async_shutdown error: system:10054 (An existing connection was forcibly closed by the remote host)
[2014-07-08 14:51:35] [error] Underlying Transport Error
4

2 回答 2

7
websocketpp::server<websocketpp::config::asio> server;

server.clear_access_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload); 
// this will turn off console output for frame header and payload

server.clear_access_channels(websocketpp::log::alevel::all); 
// this will turn off everything in console output

更多细节可以在这里找到: http ://www.zaphoyd.com/websocketpp/manual/reference/logging

于 2014-10-15T13:37:06.970 回答
0

您必须指定正在运行的 socket.io 服务器的有效 ip 和端口

IE。如果您的套接字 io 服务器在本地服务器上运行,您应该给出

connect("http://localhost:8080")

这可能对其他有同样问题的人有帮助

于 2015-12-30T09:24:14.573 回答