Hi,
I am new to websocket++. I am using version /0.3.0-alpha4 in a GUI application in debug mode.
So far, I am able to connect with uri ( ws://localhost:30000).
On closing the application, I am closing the connection like..
m_client.stop();
while (!this->m_client.stopped())
{
::Sleep(50);
}
if(m_hdl._empty() == false)
{
m_client.close(m_hdl, websocketpp::close::status::normal, "Success");
}
m_hdl.reset();
Application is closing but there is lots of memory leak being detected. If I am not calling connect method which is as follows, then no memory leaks! Since no connection made. Nothing to free. So some where prb is in closing the connection. Please Help.
bool WebsocketClient::Connect( std::string &uri)
{
websocketpp::lib::error_code ec;
client::connection_ptr con = m_client.get_connection(uri, ec);
if (ec)
{
return false;
}
// Grab a handle for this connection so we can talk to it in a thread
// safe manor after the event loop starts.
m_hdl = con->get_handle();
// Queue the connection. No DNS queries or network connections will be
// made until the io_service event loop is run.
m_client.connect(con);
// Create a thread to run the ASIO io_service event loop
websocketpp::lib::thread asio_thread(&client::run, &m_client);
}