Skip to content
Snippets Groups Projects
Commit 888f753e authored by phil's avatar phil
Browse files

Add missing docstrings for TCP*Pipe and FDSourceSink

parent 804d65c0
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,13 @@ class UDPDrain(Drain):
class FDSourceSink(Source):
"""Use a file descriptor as source and sink
+-------------+
>>-| |->>
| |
>-|-[file desc]-|->
+-------------+
"""
def __init__(self, fd, name=None):
Source.__init__(self, name=name)
self.fd = fd
......@@ -138,6 +145,13 @@ class FDSourceSink(Source):
class TCPConnectPipe(Source):
"""TCP connect to addr:port and use it as source and sink
+-------------+
>>-| |->>
| |
>-|-[addr:port]-|->
+-------------+
"""
def __init__(self, addr="", port=0, name=None):
Source.__init__(self, name=name)
self.addr = addr
......@@ -156,6 +170,13 @@ class TCPConnectPipe(Source):
self._send(self.fd.recv(65536))
class TCPListenPipe(TCPConnectPipe):
"""TCP listen on [addr:]port and use first connection as source and sink ; send peer address to high output
+-------------+
>>-| +-[peer]-|->>
| / |
>-|-[addr:port]-|->
+-------------+
"""
def __init__(self, addr="", port=0, name=None):
TCPConnectPipe.__init__(self, addr, port, name)
self.connected = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment