Skip to content

Commit

Permalink
Add an option to dispatch packets directly from the receiving
Browse files Browse the repository at this point in the history
thread.
  • Loading branch information
sobomax committed Mar 26, 2024
1 parent 002aa40 commit 33b4327
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sippy/Udp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ def run(self):
continue
if self.userv.uopts.family == socket.AF_INET6:
address = ('[%s]' % address[0], address[1])
ED2.callFromThread(self.userv.handle_read, data, address, rtime)
if not self.userv.uopts.direct_dispatch:
ED2.callFromThread(self.userv.handle_read, data, address, rtime)
else:
self.userv.handle_read(data, address, rtime)
self.userv = None

_DEFAULT_FLAGS = socket.SO_REUSEADDR
Expand All @@ -137,6 +140,7 @@ def run(self):
class Udp_server_opts(object):
laddress = None
data_callback = None
direct_dispatch = False
family = None
flags = _DEFAULT_FLAGS
nworkers = _DEFAULT_NWORKERS
Expand Down

0 comments on commit 33b4327

Please sign in to comment.