boost.asio:demo.
demo1:tcpsocket
十年的赣县网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。
成都全网营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整赣县建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。
成都创新互联公司从事“
赣县网站设计”,“
赣县网站推广”以来,每个客户项目都认真落实执行。
#include #include #include #include #include #include #include #include #include usingnamespaceboost::asio; intmain() { io_serviceservice{}; ip::tcp::endpointend_point{ip::address::from_string("192.168.1.0"),80}; ip::tcp::socketsocket{service}; socket.open(ip::tcp::v4()); socket.connect(end_point); socket.write_some(buffer("GET/indexrn")); std::cout<<"socketavailable:"<demo2:udpsocket
#include #include #include #include #include #include #include #include #include usingnamespaceboost::asio; intmain() { io_serviceservice{}; ip::udp::endpointend_point_receiver{ip::address::from_string("192.168.1.0"),80}; ip::udp::socketsocket{service}; socket.open(ip::udp::v4()); socket.connect(end_point); charthe_buffer[1024]{}; socket.send_to(buffer("testn"),end_point_receiver);//senddatatospecifyaddress(theportis80). ip::udp::endpointend_point_sender{}; std::cout<<"thesenderaddress:"<demo3:查询域名ip地址.
#include #include #include #include #include #include #include #include #include usingnamespaceboost::asio; intmain() { io_serviceservice{}; ip::tcp::resolverresolver{service}; ip::tcp::endpointend_point{}; ip::tcp::resolver::iteratorend_point_itr{resolver.resolve(ip::tcp::resolver::query("www.baidu.com","80"))}; std::cout<endpoint().address().to_string()<
分享名称:boost.asio:demo.
文章URL:http://azwzsj.com/article/cpiihe.html