mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
feat: implement get_remote_address via delegation pattern
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
import io
|
||||
from typing import (
|
||||
Optional,
|
||||
)
|
||||
|
||||
from libp2p.crypto.keys import (
|
||||
PrivateKey,
|
||||
@ -41,6 +44,10 @@ class SecureSession(BaseSession):
|
||||
|
||||
self._reset_internal_buffer()
|
||||
|
||||
def get_remote_address(self) -> Optional[tuple[str, int]]:
|
||||
"""Delegate to the underlying connection's get_remote_address method."""
|
||||
return self.conn.get_remote_address()
|
||||
|
||||
def _reset_internal_buffer(self) -> None:
|
||||
self.buf = io.BytesIO()
|
||||
self.low_watermark = 0
|
||||
|
||||
Reference in New Issue
Block a user