Skip to content

Commit

Permalink
don't catch either error for now
Browse files Browse the repository at this point in the history
  • Loading branch information
tshirtman committed Sep 22, 2019
1 parent 13dd4f5 commit 87e3df8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions oscpy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from oscpy.client import send_bundle, send_message
from oscpy.stats import Stats

UDP_MAX_SIZE = 65535


def ServerClass(cls):
"""Decorate classes with for methods implementing OSC endpoints.
Expand Down Expand Up @@ -332,10 +334,7 @@ def _listen(self):
continue

for sender_socket in read:
try:
data, sender = sender_socket.recvfrom(65535)
except ConnectionResetError:
continue
data, sender = sender_socket.recvfrom(UDP_MAX_SIZE)

for address, tags, values, offset in read_packet(
data, drop_late=drop_late, encoding=self.encoding,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,8 @@ def test_close_receiving():
port = osc.getaddress()[1]

def send_messages():
for i in range(5000):
send_message(b'/flood', [b't' * 60000], 'localhost', port, safer=True)
for i in range(500):
send_message(b'/flood', [b't' * 60000], 'localhost', port)

thread = Thread(target=send_messages)
thread.start()
Expand Down

0 comments on commit 87e3df8

Please sign in to comment.