上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 41 下一页
摘要: 网络编程 使用getaddrinfo的单纯UDP 1,UDP发送端 2,UDP接收端 UDP发送端: c++ include include include include include include include include //getaddrinfo int main(int argc 阅读全文
posted @ 2018-10-12 07:53 小石王 阅读(1168) 评论(0) 推荐(0)
摘要: 网络编程 单纯UDP通信 1,UDP发送端 2,UDP接收端 UDP发送端: "github源代码" 发送端的执行方式: UDP接收端 "github源代码" c/c++ 学习互助QQ群:877684253 本人微信:xiaoshitou5854 阅读全文
posted @ 2018-10-12 06:53 小石王 阅读(325) 评论(0) 推荐(0)
摘要: 网络编程 UDP 发送端 bind 作用 upd 发送端 调用bind函数的效果:把socket特定到一个指定的端口,如果不调用bind,内核会随机分配一个端口。 upd 发送端 调用bind函数的目的:假如有2个发送端,接收端需要识别是从哪个发送端过来的,就可以分别在发送端调用bind函数,这样一 阅读全文
posted @ 2018-10-11 23:35 小石王 阅读(4037) 评论(0) 推荐(0)
摘要: 网络编程 单纯http客户端,服务器端 1,http客户端 2,http服务器端 http客户端: "github源代码" 发送端的执行方式: http服务器端 "github源代码" 测试方式: c/c++ 学习互助QQ群:877684253 本人微信:xiaoshitou5854 阅读全文
posted @ 2018-10-11 20:47 小石王 阅读(3147) 评论(0) 推荐(0)
摘要: 直接gdb pgname 参数1 这种方式,参数1是不会带到gdb里的 1,首先启动程序 2,设置程序的参数 阅读全文
posted @ 2018-10-11 08:22 小石王 阅读(1532) 评论(0) 推荐(2)
摘要: 网络编程 文件传输 1,文件发送端 2,文件接收端 文件发送端: "github源代码" 接收端的执行方式: c/c++ 学习互助QQ群:877684253 本人微信:xiaoshitou5854 阅读全文
posted @ 2018-10-10 08:05 小石王 阅读(2672) 评论(0) 推荐(0)
摘要: 网络编程 getaddrinfo 函数 解析网址,返回IP地址。 例子: "github源代码" c/c++ 学习互助QQ群:877684253 本人微信:xiaoshitou5854 阅读全文
posted @ 2018-10-09 23:25 小石王 阅读(4712) 评论(0) 推荐(0)
摘要: 网络编程 bind函数 bind的作用是确定端口号。 正常处理都是先bind,然后listen 如果不bind,直接listen,会是什么结果? 内核会自动随机分配一个端口号 例子: c++ include include include include include include void p 阅读全文
posted @ 2018-10-09 08:25 小石王 阅读(1969) 评论(0) 推荐(0)
摘要: socket API 调用后的错误判断 perror errno 调用完socket API后,需要判断调用是否成功与失败。如果失败,会自动设置errno(是个整数), 并且用perror可以打印出具体的错误信息。 注意点: 1,如果有多个socket API调用失败,errno存放的是最后一个失败 阅读全文
posted @ 2018-10-08 22:24 小石王 阅读(1261) 评论(0) 推荐(0)
摘要: 基本线程管理 join detach join:主线程等待被join线程结束后,主线程才结束。 detach:主线程不等待被detach线程。 问题1:子线程什么时点开始执行? std::thread t(fun);执行后,就开始执行了。 问题2:在哪里调用join或者detach 1,使用deta 阅读全文
posted @ 2018-10-07 23:11 小石王 阅读(3292) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 41 下一页