Commit 878f963b authored by Sam Rushing's avatar Sam Rushing

coro_socket_transport: if we're a server, record the peer address.

parent 4ac29207
...@@ -38,6 +38,8 @@ class coro_socket_transport(l4_transport.Transport): ...@@ -38,6 +38,8 @@ class coro_socket_transport(l4_transport.Transport):
# The socket # The socket
s = None s = None
# peer
peer = None
def __init__(self, ip=None, port=22, bind_ip=None, hostname=None, sock=None): def __init__(self, ip=None, port=22, bind_ip=None, hostname=None, sock=None):
self.ip = ip self.ip = ip
...@@ -48,6 +50,7 @@ class coro_socket_transport(l4_transport.Transport): ...@@ -48,6 +50,7 @@ class coro_socket_transport(l4_transport.Transport):
self.s = coro.make_socket(socket.AF_INET, socket.SOCK_STREAM) self.s = coro.make_socket(socket.AF_INET, socket.SOCK_STREAM)
else: else:
self.s = sock self.s = sock
self.peer = self.s.getpeername()
def connect(self): def connect(self):
if self.bind_ip is not None: if self.bind_ip is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment