i am calling the async_write like this //created a buffer for my data which is around 5000 bytes and passed this in lemda, so that it will not destroy till the callback invoked. std::unique_ptr ptrMesssage(new char[strMessage.length() + 1],std::default_delete()); memset(ptrMesssage.get(), 0, strMessage.length() + 1); memcpy(ptrMesssage.get(), strMessage.c_str(), strMessage.length()); boost::asio::mutable_buffer objBuff = boost::asio::buffer(ptrMesssage.get(), strlen(ptrMesssage.get())); ws_.async_write(objBuff, [this,ptrMesssage = std::move(ptrMesssage)](beast::error_code ec, std::size_t transfer) { });
actually the issue which i am facing right now is that my program is consuming more memory means ptrMesssage are created much faster then its destroy. For example:- i have send 1000 messages using async write but i received the call back for 600 messages. rest 400 are in the processing. This gap between the number of creation of message and deletion is continuously increasing as the application continue running. How should i hanlded this.
Nice session
How to add SSL to this program?
Why did you use make_shared. Is there any specific reason?
Can you please make a video on how to convert this to WSS(https)
thank working on android (NDK)
adam asmis ya
valla başkan :D neredennn nereyeee nereden nereye yeni keşfetttim bende
Please post your code
i am calling the async_write like this
//created a buffer for my data which is around 5000 bytes and passed this in lemda, so that it will not destroy till the callback invoked.
std::unique_ptr ptrMesssage(new char[strMessage.length() + 1],std::default_delete());
memset(ptrMesssage.get(), 0, strMessage.length() + 1);
memcpy(ptrMesssage.get(), strMessage.c_str(), strMessage.length());
boost::asio::mutable_buffer objBuff = boost::asio::buffer(ptrMesssage.get(), strlen(ptrMesssage.get()));
ws_.async_write(objBuff,
[this,ptrMesssage = std::move(ptrMesssage)](beast::error_code ec, std::size_t transfer)
{
});
actually the issue which i am facing right now is that my program is consuming more memory means ptrMesssage are created much faster then its destroy.
For example:- i have send 1000 messages using async write but i received the call back for 600 messages. rest 400 are in the processing. This gap between the number of creation of message and deletion is continuously increasing as the application continue running.
How should i hanlded this.