plestylib.traffic.tcp_ip
========================

.. py:module:: plestylib.traffic.tcp_ip


Classes
-------

.. autoapisummary::

   plestylib.traffic.tcp_ip.TCPIPTrafficManager


Module Contents
---------------

.. py:class:: TCPIPTrafficManager(host, port, timeout=5, write_termination='\r\n', read_termination='\r\n')

   Bases: :py:obj:`plestylib.traffic.TrafficManager`


   A TrafficManager implementation for managing TCP/IP communication.

   This class provides methods to open, close, and communicate with instruments over TCP/IP.

   Initialize the TrafficManager with the given address and timeout.

   :param address: The address of the resource.
   :type address: str
   :param timeout: The timeout for operations in seconds. Defaults to 5.
   :type timeout: int, optional


   .. py:attribute:: host


   .. py:attribute:: port


   .. py:attribute:: write_termination
      :value: Multiline-String

      .. raw:: html

         <details><summary>Show Value</summary>

      .. code-block:: python

         """
         """

      .. raw:: html

         </details>




   .. py:attribute:: read_termination
      :value: Multiline-String

      .. raw:: html

         <details><summary>Show Value</summary>

      .. code-block:: python

         """
         """

      .. raw:: html

         </details>




   .. py:method:: _open(*args, **kwargs)

      Open the TCP/IP connection to the instrument.

      :param args: Positional arguments for the specific implementation (not used in this case).
      :param kwargs: Keyword arguments for the specific implementation (not used in this case).



   .. py:method:: _close()

      Close the connection to the resource.

      This method should be implemented by subclasses to handle the specific details of closing the connection.



   .. py:method:: receive_one(timeout=None)

      We leave this function public for direct use in some cases
      where the caller needs more control over the receiving process
      (e.g. in some requests, two responses might be expected, one for
      instant feedback and one for the final report when the operation is complete).



   .. py:method:: _send_command(command: str, timeout=None, expect_response=True)

      Send a command to the resource and return the response.

      :param command: The command to send.
      :type command: str
      :param timeout: The timeout for the command in seconds.
                      Defaults to the instance's timeout.
      :type timeout: int, optional

      :returns: The response from the resource, or False if the command failed or timed out.
      :rtype: Any



