void epoll_func(epoll_event event){
char str[BUFSIZE] = {'\0'};
int c =0;
if(event.data.fd == connfd && EPOLLIN){
while(true){
c = read( connfd, str, BUFSIZE);
write( 1, str, c);
if(c<BUFSIZE)
break;
}
}else if( event.data.fd == 0 && EPOLLIN ){
while(true){
c = read( 0, str, BUFSIZE);
send( connfd, str, c, 0);
if(c<BUFSIZE)
break;
}
}
}
Write data to the master, but also read the data to write their own. How to do?
thanks very much.