Commit 858bd245 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

FD_ZERO/SET must be done everytime before select().


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@264 e5f2f494-b856-4b98-b285-d166d9295462
parent 271fc481
......@@ -79,12 +79,12 @@ main(int argc, char* argv[]) {
int ss = session.getSocket();
int nfds = max(ps, ss) + 1;
FD_ZERO(&fds);
FD_SET(ps, &fds);
FD_SET(ss, &fds);
cout << "server running" << endl;
while (true) {
FD_ZERO(&fds);
FD_SET(ps, &fds);
FD_SET(ss, &fds);
int n = select(nfds, &fds, NULL, NULL, NULL);
if (n < 0)
throw FatalError("select error");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment