c - Return mechanism about epoll_wait -
i've seen epoll exmaples using epoll_wait
like
int i, n; ... n = epoll_wait(epfd, events, max_events, -1); (i = 0; < n; ++i) { do_something_with(events[i]); }
i alter to
int i; ... (i = 0; < epoll_wait(epfd, events, max_events, -1); ++i) { do_something_with(events[i]); }
when socket connect programme , send something, epoll_wait
homecoming once, connecting action, unable read after (previous version, twice, connect , read). what's magic it?
the finish c code @ http://pastebin.com/bx4hbhdm
python client is
import socket s = socket.socket(socket.af_inet, socket.sock_stream) s.connect(('127.0.0.1', 4999)) s.sendall('hello') s.close()
the changed version calls epoll_wait every loop iteration blocking 1 time again after processing 1 event. have phone call epoll_wait 1 time front end , loop.
c epoll
No comments:
Post a Comment