Merge pull request #269 from ralexstokes/add-reset-to-network-stream

Expose `reset` method on `NetStream`
This commit is contained in:
Alex Stokes 2019-08-26 21:27:57 +02:00 committed by GitHub
commit 9b60e1757d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -50,3 +50,6 @@ class NetStream(INetStream):
"""
await self.muxed_stream.close()
return True
async def reset(self) -> bool:
return await self.muxed_stream.reset()

View File

@ -42,3 +42,9 @@ class INetStream(ABC):
close the underlying muxed stream
:return: true if successful
"""
@abstractmethod
async def reset(self) -> bool:
"""
Close both ends of the stream.
"""