:py:mod:`pex.proto.channel.client` ================================== .. py:module:: pex.proto.channel.client Module Contents --------------- .. py:class:: ChannelClient(client: socket.socket) Bases: :py:obj:`object` Subclass of pex.proto.channel module. This subclass of pex.proto.channel module represents Python implementation of the channel client. .. py:method:: stash() -> bytes Return stashed data. :return bytes: stashed data .. py:method:: disconnect() -> None Disconnect connected socket. :return None: None .. py:method:: send(data: bytes) -> None Send data to the channel socket. :param bytes data: data to send :return None: None :raises RuntimeError: with trailing error message .. py:method:: read(size: int) -> bytes Read data from the channel socket. :param int size: size of data :return bytes: read data :raises RuntimeError: with trailing error message .. py:method:: readall() -> bytes Read all possible data from the channel socket. :return bytes: read data :raises RuntimeError: with trailing error message .. py:method:: read_until(token: str) -> bytes Read data from the channel socket until specific token. :param str token: token to read data until :return bytes: read data :raises RuntimeError: with trailing error message .. py:method:: send_command(command: str, output: bool = True, decode: bool = False, newline: bool = True) -> Union[str, None, bytes] Send command to the channel socket. :param str command: command to send :param bool output: True if wait for output else False :param bool decode: True if decode else False :param bool newline: True to add newline char else False :return Union[str, None, bytes]: output if output is True else None :raises RuntimeError: with trailing error message .. py:method:: send_token_command(command: str, token: str, output: bool = True, decode: bool = False, newline: bool = True) -> Union[str, None, bytes] Send command and read output until specific token. :param str command: command to send :param str token: token to read data until :param bool output: True if wait for output else False :param bool decode: True if decode else False :param bool newline: True to add newline char else False None for not printing but returning read data :return Union[str, None, bytes]: output if output is True and printer is None else None .. py:method:: interact(terminator: str = '\n') -> None Interact with the channel socket. :param str terminator: data to send after each command :return None: None :raises RuntimeWarning: with trailing warning message