mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
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
This commit is contained in:
parent
271fc481f9
commit
858bd245a9
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user