Skip to content

Commit

Permalink
Merge pull request #4 from adufftpc/add_setsockopt_method
Browse files Browse the repository at this point in the history
Added setsockopt method
  • Loading branch information
bashkirtsevich authored Jul 30, 2024
2 parents 6aeb95d + ad19b9f commit 0f02656
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/aioudp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def run(self, host, port, loop):

self._run_future(self._send_periodically(), self._recv_periodically())

def setsockopt(self, level, optname, value = None, optlen = None):
if value is not None and optlen is None:
self._sock.setsockopt(level, optname, value)
elif value is None and optlen is not None:
self._sock.setsockopt(level, optname, value, optlen)

def subscribe(self, fut):
self._subscribers[id(fut)] = fut

Expand Down

0 comments on commit 0f02656

Please sign in to comment.