boost: readline for tcp client
boost: readline for tcp client
我正在使用boost在c++中开发tcp服务器。我想逐行处理传入数据,并寻找插座。readLine方法。然而,我只能找到一个read_some()方法。我不知道"some"的定义是什么,但我认为字符串不一定以"n"结尾。
那么我如何使用boost实现socket.readLine() ?
我假设您正在使用boost::asio。如果是,则有一个read_until()函数可以满足您的要求。
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/reference/read_until.html有read_until
使用boost:: asio: read_until(. .)。
相关文章:
- 通过套接字[TCP]传输数据 如何在C / C ++中打包多个整数并使用send() recv()传输数据
- VSOMEIP-2个设备之间的通信(TCP/UDP)不工作
- 是否可以用"iostream"包装现有的TCP/OOpenSSL会话
- 我可以与 python 服务器而不是 c++ 客户端建立 tcp/ip 套接字吗?
- 提升 Asio TCP 服务器 处理多个客户端
- 通过TCP的PvP通信问题
- C++ boost::asio::ip::tcp::acceptor 有时不接受连接器?
- AWS IoT 开发工具包:通过 TCP 端口 443 使用 MQTT
- 计算出有多少客户端可以连接到我正在使用的一些tcp服务器代码
- 通过单独的 tcp 流建立 http 连接
- 读取 TCP 标头并使用RAW_SOCKET管理 TCP 连接
- C++ TCP 套接字通信 - 连接按预期工作,几秒钟后失败,没有收到新数据,read() 和 recv() 块
- grpc 的 ServerBuilder::AddListeningPort() 总是返回 TCP 端口零
- TCP 服务器的异步读取使用 boost::asio 打印客户端套接字发送的数据
- 如何在没有侦听器的情况下创建 TCP 连接?
- FindPOCO CMAKE 脚本无法找到 MYSQL::client
- 为什么当通过 TCP 发送的消息速率增加时,请求-响应消息对的延迟会降低?
- C++ TCP 套接字 | 无法将"std::__cxx11::字符串"转换为"const
- boost: readline for tcp client
- IOCP C++ TCP client