Skip to content

Instantly share code, notes, and snippets.

@chantra
Created October 6, 2017 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chantra/b774ae2e6661a6cc52e1b48bd4b33f73 to your computer and use it in GitHub Desktop.
Save chantra/b774ae2e6661a6cc52e1b48bd4b33f73 to your computer and use it in GitHub Desktop.
diff --git a/lib/exabgp/reactor/network/connection.py b/lib/exabgp/reactor/network/connection.py
index 15763d7..def737f 100644
--- a/lib/exabgp/reactor/network/connection.py
+++ b/lib/exabgp/reactor/network/connection.py
@@ -43,9 +43,11 @@ class Connection (object):
# peer and local are strings of the IP
try:
self.defensive = environment.settings().debug.defensive
+ self.max_loop_speed = environment.settings().reactor.speed
self.logger = Logger()
except RuntimeError:
self.defensive = True
+ self.max_loop_speed = 1.0
self.logger = FakeLogger()
self.afi = afi
@@ -88,7 +90,7 @@ class Connection (object):
def reading (self):
while True:
try:
- r,_,_ = select.select([self.io,],[],[],0)
+ r,_,_ = select.select([self.io,],[],[],self.max_loop_speed/100)
except select.error as exc:
if exc.args[0] not in error.block:
self.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment