Skip to content

Commit

Permalink
Possible BugFix #423.
Browse files Browse the repository at this point in the history
  • Loading branch information
dddomodossola committed Feb 15, 2021
1 parent 6dbe6c8 commit d479330
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions remi/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ class WebSocketsHandler(socketserver.StreamRequestHandler):

magic = b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'

def __init__(self, headers, *args, **kwargs):
def __init__(self, headers, request, client_address, server, *args, **kwargs):
self.headers = headers
self.server = server
self.handshake_done = False
self._log = logging.getLogger('remi.server.ws')
socketserver.StreamRequestHandler.__init__(self, *args, **kwargs)
socketserver.StreamRequestHandler.__init__(self, request, client_address, server, *args, **kwargs)

def setup(self):
socketserver.StreamRequestHandler.setup(self)
Expand Down Expand Up @@ -200,7 +201,7 @@ def send_message(self, message):
message = message.encode('utf-8')
out = out + message

readable, writable, errors = select.select([], [self.request,], [], 0) #last parameter is timeout, when 0 is non blocking
readable, writable, errors = select.select([], [self.request,], [], self.server.websocket_timeout_timer_ms) #last parameter is timeout, when 0 is non blocking
#self._log.debug('socket status readable=%s writable=%s errors=%s'%((self.request in readable), (self.request in writable), (self.request in error$
writable = self.request in writable
if not writable:
Expand Down

0 comments on commit d479330

Please sign in to comment.