2019年4月26日

摘要: int connect_nonb(int sockfd, const SA *saptr, socklen_t salen, int nsec) { int flags, n, error; socklen_t len; fd_set rset, wset; struct timeval tval; ... 阅读全文
posted @ 2019-04-26 21:52 soldierback 阅读(267) 评论(0) 推荐(0) 编辑
 
摘要: void str_cli(FILE *fp, int sockfd) { pid_t pid; char sendline[MAXLINE], recvline[MAXLINE]; if ( (pid = fork()) == 0) { /* child: server -> stdout */ while (read(sock... 阅读全文
posted @ 2019-04-26 20:51 soldierback 阅读(173) 评论(0) 推荐(0) 编辑
 
摘要: void str_cli(FILE *fp, int sockfd) { int maxfdp1, val, stdineof; ssize_t n, nwritten; fd_set rset, wset; char to[MAXLINE], fr[MAXLINE]; char *toiptr, *to... 阅读全文
posted @ 2019-04-26 20:40 soldierback 阅读(341) 评论(0) 推荐(0) 编辑