随笔分类 -  网络编程

摘要:第二次作业服务器端:View Code 1 View Code 2 /* 3 * 服务器端程序: 4 * 接收客户的连接,并显示客户的IP 地址和端口号; 5 * 接收客户端传来的字符串并反转后返回; 6 * */ 7 #include <stdio.h> 8 #include <stdlib.h> 9 #include <string.h> 10 #include <unistd.h> 11 #include <sys/types.h> 12 #include <sys/socket.h> 13 #include < 阅读全文
posted @ 2013-04-15 23:56 jeccey 阅读(263) 评论(0) 推荐(0)
摘要:Socket Address Structure——头文件<netinet/in.h>IPv4 Socket Address StructureView Code /* IPv4 Socket Address Structure */typedef uint32_t in_addr_t;typedef uint16_t in_port_t;typedef unsigned short sa_family_t;struct in_addr{ in_addr_t s_addr; /* 32-bit IPv4 address */ ... 阅读全文
posted @ 2013-04-11 09:24 jeccey 阅读(440) 评论(0) 推荐(0)