boost::asio::buffer: Getting the buffer size and preventing buffer overflow?

前端 未结 3 1385
独厮守ぢ
独厮守ぢ 2020-12-29 14:17

I have the two following functions for sending and receiving packets.

void send(std::string protocol)
{
    char *request=new char[protocol.size()+1];
    re         


        
3条回答
  •  萌比男神i
    2020-12-29 14:48

    Typically a communication protocol either uses fixed length messages or messages that contain header that tells the length of message.

    Boost.Asio online documentation contains large set of examples and tutorials so you should perhaps start from there. Wikipedia is good source for explaining data transmission terminology, boost asio documentation does not do it.

提交回复
热议问题