日期:2014-05-16 浏览次数:20566 次
while((len = read(*pfd,buffer,MAXSIZE))) 188 { 189 printf("len=%d\n",len); 190 if(len == -1) 191 { 192 printf("read error!!\n"); 193 exit(0); 194 } 195 printf("buffer:%s\n",buffer); 196 write(fd,buffer,len); }
367 while((len = read(fd,buffer,MAXSIZE))) //send file 368 { 369 printf("len = %d\n",len); 370 printf("buffer:%s\n",buffer); 371 write(*pPeerfd,(void *)buffer,len); 372 memset(buffer,'\0',MAXSIZE); 373 size += len; 374 if(len < MAXSIZE) 375 break; 376 }