libmuscle.mcp.tcp_transport_client module

exception libmuscle.mcp.tcp_transport_client.NoPendingResponse[source]

Bases: RuntimeError

class libmuscle.mcp.tcp_transport_client.TcpTransportClient(location: str)[source]

Bases: TransportClient

A client that connects to a TCPTransport server.

call(request: Buffer, timeout_handler: TimeoutHandler | None = None) tuple[Buffer, tuple[ProfileTimestamp, ProfileTimestamp, ProfileTimestamp]][source]

Send a request to the server and receive the response.

This is a blocking call.

Parameters:
  • request – The request to send

  • timeout_handler – Optional timeout handler. This is used for communication deadlock detection.

Returns:

The received response

static can_connect_to(location: str) bool[source]

Whether this client class can connect to the given location.

Parameters:

location – The location to potentially connect to.

Returns:

True iff this class can connect to this location.

close() None[source]

Closes this client.

This closes any connections this client has and performs other shutdown activities as needed.