Skip to content

Commit

Permalink
binarize handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jul 2, 2023
1 parent 8e1881d commit e73d91e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions hivemind_core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ def on(self, event_name, handler):
self.emitter.on(event_name, handler)

def on_message(self, message):
if isinstance(message, bytes):
LOG.info(f"received binary data: {len(message)}")
self.protocol.handle_binary_message(message, self.client)
else:
message = self.client.decode(message)
LOG.info(f"received {self.client.peer} message: {message}")
self.protocol.handle_message(message, self.client)
message = self.client.decode(message)
LOG.info(f"received {self.client.peer} message: {message}")
self.protocol.handle_message(message, self.client)

def open(self):
auth = self.request.uri.split("/?authorization=")[-1]
Expand Down

0 comments on commit e73d91e

Please sign in to comment.