内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

boost.asio:demo.

demo1:tcpsocket

十年的贛縣網(wǎng)站建設(shè)經(jīng)驗(yàn),針對設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。成都全網(wǎng)營銷推廣的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整贛縣建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)公司從事“贛縣網(wǎng)站設(shè)計(jì)”,“贛縣網(wǎng)站推廣”以來,每個客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

#include<iostream> #include<stdexcept> #include<exception> #include<string> #include<fstream> #include<thread> #include<boost/asio.hpp> #include<boost/system/error_code.hpp> #include<boost/system/system_error.hpp> 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:"<<socket.available()<<std::endl; charthe_buffer[1024]{}; std::size_tsize{socket.read_some(buffer(the_buffer,1024))}; std::cout<<"sizeofreading:"<<size<<std::endl; socket.shutdown(ip::tcp::socket::shutdown_receive); socket.close(); std::cout<<the_buffer<<std::endl; return0; }

demo2:udpsocket

#include<iostream> #include<stdexcept> #include<exception> #include<string> #include<fstream> #include<thread> #include<boost/asio.hpp> #include<boost/system/error_code.hpp> #include<boost/system/system_error.hpp> 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:"<<end_point_sender.address().to_string()<<std::endl; socket.receive_from(buffer(the_buffer,1024),end_point_sender); std::cout<<"receiveddata:"<<the_buffer<<std::endl; return0; }

demo3:查詢域名ip地址.

#include<iostream> #include<stdexcept> #include<exception> #include<string> #include<fstream> #include<thread> #include<boost/asio.hpp> #include<boost/system/error_code.hpp> #include<boost/system/system_error.hpp> 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<<end_point_itr->endpoint().address().to_string()<<std::endl; return0; }

本文標(biāo)題:boost.asio:demo.
轉(zhuǎn)載注明:http://www.rwnh.cn/article44/cpiihe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站靜態(tài)網(wǎng)站、網(wǎng)站內(nèi)鏈、微信小程序網(wǎng)站策劃、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)
海淀区| 牡丹江市| 定州市| 金川县| 临潭县| 台北县| 荣昌县| 巢湖市| 永仁县| 恩平市| 镇平县| 朝阳市| 遂昌县| 东方市| 枣阳市| 遂平县| 保康县| 龙口市| 泾源县| 岗巴县| 彭阳县| 天气| 分宜县| 永和县| 珲春市| 马鞍山市| 涟水县| 开封市| 册亨县| 泽库县| 江油市| 崇义县| 宣化县| 新竹县| 云安县| 卓尼县| 睢宁县| 紫阳县| 长沙市| 肃宁县| 营口市|