boost asio client
来源:互联网 发布:手机散热软件 编辑:程序博客网 时间:2024/06/05 00:43
#include <iostream>#include <boost/asio.hpp>#include <boost/array.hpp>#include <boost/shared_ptr.hpp>#include <boost/enable_shared_from_this.hpp>using namespace boost::asio::ip;const int max_length = 1024;char request_buffer[max_length] = {};char reply_buffer[max_length] = {};int main(){boost::asio::io_service io_service;tcp::endpoint end_point(boost::asio::ip::address::from_string("127.0.0.1"), 8888);tcp::socket tcp_socket(io_service);tcp_socket.connect(end_point);for (;;){std::cin.getline(request_buffer, max_length);size_t request_length = std::strlen(request_buffer);boost::asio::write(tcp_socket, boost::asio::buffer(request_buffer, request_length));size_t reply_length = boost::asio::read(tcp_socket, boost::asio::buffer(reply_buffer, request_length));std::cout.write(reply_buffer, reply_length);std::cout << "\n";}return 0;}
0 0
- boost asio client
- Boost Asio multi-threaded blocking server/client
- boost::asio的http client应用笔记
- boost::asio学习之[三]同步service,client
- boost::asio学习之[四]udp client server 异步server
- Boost Asio
- boost asio
- Boost.asio
- boost asio
- boost asio
- boost.asio
- Boost.Asio
- boost.asio
- boost asio
- BOOST::ASIO
- boost asio
- boost asio
- boost asio
- POJ 1027:The Same Game 较(chao)为(ji)复(ma)杂(fan)的模拟
- GCD之线程组
- idea 显示行号
- 16 Power digit sum - Project Euler
- Android:View绘制流程
- boost asio client
- 分享几个程序员应该知道的网站和技术博客
- javascript基本语法 5 引用类型-----去掉数组中的重复项
- 关于UIScreen的applicationFrame和bounds方法区别
- lightoj 1258 - Making Huge Palindromes 【Manacher】
- 在grub中添加win7(以及从win7来的win10)的启动项
- 如何清除windows入侵的记录
- strcpy函数的实现
- 硬件-CPU3