======================
I organize my manager Class like:
class WebSocketClient
{
public:
using ws_connection_tls_ptr = std::shared_ptr<websocketpp::connection<websocketpp::config::asio_tls_client>>;
class Connection
{
private:
ws_connection_tls_ptr ws_con_tls_ptr_;
}
private:
using ws_client_tls = websocketpp::client<websocketpp::config::asio_client>;
std::shared_ptr<ws_client_tls> ws_client_tls_ptr_;
std::map<ws_connection_tls_ptr, ConnectionPtr, std::owner_less<ws_connection_tls_ptr>> con_tls_map_;
}
=================
Procedure:
Start a WebSocketServer to Handle TLS Connections(Just echo message which it received)
Start a WebSocketClient and Create a connection to WebSocketServer
Send message in WebSocketClient.(ps: I can see the message in Server's OnMessage and Client's OnMessage)
Then I Stop my WebSocketClient and it Quit
I got Segmentation fault(core dump)
Here is what I got when I gdb:
unlink(av, p, bck, fwd)
#0 in malloc_consolidate at malloc.c
#1 in _int_free at malloc.c
#2 in CRYPTO_free()
#3 in ssl_buf_freelist_free()
#4 in SSL_CTX_free()
#5 in boost::asio::ssl::context::~context()
.......
#16 in websocketpp::connection<websocketpp::config::asio_tls_client>::~connection
.......
#31 in std::map<ws_connection_tls_ptr, ConnectionPtr, std::owner_less<ws_connection_tls_ptr>>::~map()
#32 in WebSocketClient::~WebSocketClient()
Hi, version is 0.8.1
====================== I organize my manager Class like:
================= Procedure:
Here is what I got when I gdb:
================================
I have no idea what happened, thanks anyway!