Chinaunix首页 | 论坛 | 博客
  • 博客访问: 305731
  • 博文数量: 214
  • 博客积分: 4258
  • 博客等级: 上校
  • 技术积分: 2021
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-02 09:16
个人简介

http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net

文章分类

全部博文(214)

文章存档

2018年(16)

2015年(1)

2014年(2)

2012年(22)

2011年(173)

发布时间:2011-09-22 19:00:05

9.1 概述        gethostname和gethostbyaddr在主机名字和ip地址间进行转换;       getservbyname和getservbyport在服务名和端口号间进行转换。9.2 域名系统        严格来说,FQDN也称为绝对名字(ab.........【阅读全文】

阅读(414) | 评论(0) | 转发(0)

发布时间:2011-09-21 11:48:56

/* include readline */#include "unp.h"static int read_cnt;static char *read_ptr;static char read_buf[MAXLINE];static ssize_tmy_read(int fd, char *ptr){ if (read_cnt <= 0) {again:  if ( (read_cnt = read(fd, read_buf, sizeof(read_buf))) < 0) {&n.........【阅读全文】

阅读(262) | 评论(0) | 转发(0)

发布时间:2011-09-21 10:34:04

#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <netdb.h>#include <sys/types.h>#include <netinet/in.h>#include <sys/socket.h>    //added by liyuan#include <netinet/in.h>    //added by liyuan#include <arpa/inet.h>     //added.........【阅读全文】

阅读(175) | 评论(0) | 转发(0)

发布时间:2011-09-21 10:21:39

/* tcp4_10localip.c */#include <stdio.h> #include <string.h> #include <netdb.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <net/if_arp.h> #include <net/ethernet.h> #include <signal.h.........【阅读全文】

阅读(235) | 评论(0) | 转发(0)

发布时间:2011-09-20 21:33:17

8.1 概述 写一个长度为0的数据是可行的,这导致一个包含ip头部、8字节udp头部和没有数据的ip数据报。这也意味着对于数据报协议,recvfrom返回0也是可行的:它不代表对方已关闭了连接,这与tcp套接口上的read返回0的情形不同。由于udp是无连接的,这就没有诸如关闭udp连接之类的事情。8.8 验证接收到的响应 &.........【阅读全文】

阅读(323) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册