libmuscle.mcp.tcp_transport_server module

class libmuscle.mcp.tcp_transport_server.TcpHandler(request, client_address, server)[source]

Bases: BaseRequestHandler

Handler for MCP-over-TCP connections.

This is a Python handler for Python’s TCPServer, which forwards to the RequestHandler attached to the server.

finish() None[source]

Called when shutting down the thread?

handle() None[source]

Handles requests on a socket

receive_request() bytes | None[source]

Receives a request

Returns:

The received bytes

class libmuscle.mcp.tcp_transport_server.TcpTransportServer(handler: RequestHandler, port: int = 0)[source]

Bases: TransportServer

A TransportServer that uses TCP to communicate.

close() None[source]

Closes this server.

Stops the server listening, waits for existing clients to disconnect, then frees any other resources.

get_location() str[source]

Returns the location this server listens on.

Returns:

A string containing the location.

class libmuscle.mcp.tcp_transport_server.TcpTransportServerImpl(host_port_tuple: Tuple[str, int], streamhandler: Type, transport_server: TcpTransportServer)[source]

Bases: ThreadingMixIn, TCPServer

allow_reuse_address = True
daemon_threads = True