
网络编程
文章平均质量分 81
fengyelengfeng
这个作者很懒,什么都没留下…
展开
-
socket 学习(代码)
Socket 编程 一、 基本知识 主机字节序和网络字节序 主机字节序即内存中存储字节的方法有: 1. Little endian:将低序字节存储在起始地址 2. Big endian:将高序字节存储在起始地址 网络字序表示网络协议在处理多字节时的顺序,一律为big endian 主机字节序和网络字节序转换的函数: #include uint16_t htons(uint16_原创 2015-03-16 17:13:04 · 735 阅读 · 0 评论 -
socket 代码学习
/*简单的网络编程实例。该实例是一个客户端程序,它首先连接到一个标准时间服务器上,从服务器读取当前时间,然后显示时间。*/ #include #include #include #include #include #include #include #define HOSTNAMELEN 40 #define BUFLEN 1024 #define PORT 13原创 2015-03-16 17:25:49 · 880 阅读 · 0 评论