http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net
发布时间:2011-09-24 09:49:47
11.2 getaddrinfo函数 int getaddrinfo(const char * hostname, const char * service, const struct addrinfo * hints, struct addrinfo ** result);返回:成功返回0,出错返回非零 这个函数通过result返回一个指向addrinfo结构.........【阅读全文】
发布时间:2011-09-22 19:00:05
9.1 概述 gethostname和gethostbyaddr在主机名字和ip地址间进行转换; getservbyname和getservbyport在服务名和端口号间进行转换。9.2 域名系统 严格来说,FQDN也称为绝对名字(ab.........【阅读全文】
发布时间: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.........【阅读全文】
发布时间: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.........【阅读全文】
发布时间: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.........【阅读全文】