Websocket C++ Asynchronous Echo Server -Part II-Difference Synchronous and Asyncronous applications

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 9

  • @iamravishank
    @iamravishank 2 года назад +1

    Nice session

  • @parthkumar1252
    @parthkumar1252 2 года назад +2

    How to add SSL to this program?

  • @dziq4549
    @dziq4549 2 года назад

    Why did you use make_shared. Is there any specific reason?

  • @parthkumar1252
    @parthkumar1252 2 года назад +1

    Can you please make a video on how to convert this to WSS(https)

  • @Реальныекартинки
    @Реальныекартинки 2 года назад

    thank working on android (NDK)

  • @onurkarakaya95
    @onurkarakaya95 2 года назад +1

    adam asmis ya

    • @harunkurtdev
      @harunkurtdev 2 года назад

      valla başkan :D neredennn nereyeee nereden nereye yeni keşfetttim bende

  • @zSandman99
    @zSandman99 2 года назад

    Please post your code

  • @lalitsharma9002
    @lalitsharma9002 Год назад

    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.