Add the skeletons of noise transport and conn

This commit is contained in:
mhchia
2020-02-07 17:47:50 +08:00
parent e63584c387
commit 897e66b7e1
5 changed files with 139 additions and 5 deletions

View File

@ -35,9 +35,8 @@ class InsecureSession(BaseSession):
super().__init__(local_peer, local_private_key, is_initiator, peer_id)
self.conn = conn
async def write(self, data: bytes) -> int:
async def write(self, data: bytes) -> None:
await self.conn.write(data)
return len(data)
async def read(self, n: int = None) -> bytes:
return await self.conn.read(n)