diff --git a/doc/py-inproc.rst b/doc/py-inproc.rst index c4010b4c6..c9d164dae 100644 --- a/doc/py-inproc.rst +++ b/doc/py-inproc.rst @@ -45,7 +45,7 @@ Sending :param thread_pool: Thread pool handling the I/O :type thread_pool: :py:class:`spead2.ThreadPool` :param queues: Queues holding the generated packets (one per substream). - :type queue: List[:py:class:`spead2.InprocQueue`] + :type queues: List[:py:class:`spead2.InprocQueue`] :param config: Stream configuration :type config: :py:class:`spead2.send.StreamConfig` @@ -53,7 +53,7 @@ Sending Get the queues passed to the constructor. -.. autoclass:: spead2.send.asyncio.InprocStream(thread_pool, queue, config) +.. autoclass:: spead2.send.asyncio.InprocStream(thread_pool, queues, config) An asynchronous version of :py:class:`spead2.send.InprocStream`. Refer to :ref:`asynchronous-send` for general details about asynchronous transport. diff --git a/doc/py-send.rst b/doc/py-send.rst index 309c93e5c..7d01445f0 100644 --- a/doc/py-send.rst +++ b/doc/py-send.rst @@ -241,12 +241,16 @@ Because spead2 was originally designed for UDP, the default packet size in :py:class:`~spead2.send.StreamConfig` is quite small. Performance can be improved by increasing it (but be sure the receiver is configured to handle larger packets). -.. py:class:: spead2.send.TcpStream(thread_pool, hostname, port, config=spead2.send.StreamConfig(), buffer_size=DEFAULT_BUFFER_SIZE, interface_address='') +TCP/IP is also a connection-oriented protocol, and does not support substreams. The +`endpoints` must therefore contain exactly one endpoint (it takes a list for +consistency with :class:`~spead2.send.UdpStream`). + +.. py:class:: spead2.send.TcpStream(thread_pool, endpoints, config=spead2.send.StreamConfig(), buffer_size=DEFAULT_BUFFER_SIZE, interface_address='') :param thread_pool: Thread pool handling the I/O :type thread_pool: :py:class:`spead2.ThreadPool` - :param str hostname: Peer hostname - :param int port: Peer port + :param endpoints: Peer endpoint (must contain exactly one element). + :type endpoints: List[Tuple[str, int]] :param config: Stream configuration :type config: :py:class:`spead2.send.StreamConfig` :param int buffer_size: Socket buffer size. A warning is logged if this diff --git a/spead2/send/asyncio.py b/spead2/send/asyncio.py index ec2ab9a90..499f0432e 100644 --- a/spead2/send/asyncio.py +++ b/spead2/send/asyncio.py @@ -95,10 +95,8 @@ async def async_flush(self): ---------- thread_pool : :py:class:`spead2.ThreadPool` Thread pool handling the I/O - hostname : str - Peer hostname - port : int - Peer port + endpoints : List[Tuple[str, int]] + Peer endpoints (one per substreams). config : :py:class:`spead2.send.StreamConfig` Stream configuration buffer_size : int @@ -167,7 +165,7 @@ def callback(arg): ---------- thread_pool : :py:class:`spead2.ThreadPool` Thread pool handling the I/O - queue : :py:class:`spead2.InprocQueue` + queues : List[:py:class:`spead2.InprocQueue`] Queue holding the data in flight config : :py:class:`spead2.send.StreamConfig` Stream configuration