From 344a8621f96568e7a9dfa0cb6730b0a97a43394d Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 18 Jan 2006 00:45:01 +0000 Subject: [PATCH] better handling for max-poll-cycle --- panda/src/net/connectionReader.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/net/connectionReader.cxx b/panda/src/net/connectionReader.cxx index a6df229bdc..68a0645032 100644 --- a/panda/src/net/connectionReader.cxx +++ b/panda/src/net/connectionReader.cxx @@ -314,11 +314,11 @@ poll() { ClockObject *global_clock = ClockObject::get_global_clock(); double stop = global_clock->get_real_time() + max_poll_cycle; - process_incoming_data(sinfo); - sinfo = get_next_available_socket(PR_INTERVAL_NO_WAIT, -2); - while (sinfo != (SocketInfo *)NULL && - global_clock->get_real_time() < stop) { + while (sinfo != (SocketInfo *)NULL) { process_incoming_data(sinfo); + if (global_clock->get_real_time() >= stop) { + return; + } sinfo = get_next_available_socket(PR_INTERVAL_NO_WAIT, -2); } }