pex.proto.tcp.client

Module Contents

class pex.proto.tcp.client.TCPClient(host: str, port: int, timeout: int = 10)

Bases: object

Subclass of pex.proto.tcp module.

This subclass of pex.proto.tcp module represents Python implementation of the TCP client.

connect() None

Connect to TCP socket.

Return None:

None

Raises:

RuntimeError – with trailing error message

disconnect() None

Disconnect from TCP socket.

Return None:

None

Raises:

RuntimeError – with trailing error message

send(data: bytes) None

Send data to the socket.

Parameters:

data (bytes) – data to send

Return None:

None

Raises:

RuntimeError – with trailing error message

recv(size: int) bytes

Read data from the socket.

Parameters:

size (int) – size of data

Return bytes:

read data

Raises:

RuntimeError – with trailing error message