Skip to content

Commit

Permalink
Update ssl echo server example
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh committed Nov 7, 2021
1 parent 737b033 commit a28130d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/ssl_echo_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ def initialize(self) -> None:
# here using wrap_socket() utility.
assert self.flags.keyfile is not None and self.flags.certfile is not None
conn = wrap_socket(
self.client.connection,
self.work.connection,
self.flags.keyfile,
self.flags.certfile,
)
conn.setblocking(False)
# Upgrade plain TcpClientConnection to SSL connection object
self.client = TcpClientConnection(
conn=conn, addr=self.client.addr,
self.work = TcpClientConnection(
conn=conn, addr=self.work.addr,
)

def handle_data(self, data: memoryview) -> Optional[bool]:
# echo back to client
self.client.queue(data)
self.work.queue(data)
return None


Expand Down

0 comments on commit a28130d

Please sign in to comment.