TCPIPClient

class lsst.ts.tunablelaser.TCPIPClient(host, port, timeout=1)

Bases: object

Implements the TCP/IP connection for the TunableLaser

Parameters:
hoststr

The host of the TunableLaser server.

portint

The port of the TunableLaser server.

timeoutfloat, optional

The amount of time that the client waits for reading until timing out in seconds.

Attributes:
timeoutfloat
hoststr
portint
readerNone or StreamReader
writerNone or StreamWriter
loglogging.Logger

Attributes Summary

connected

Return True if a client is connected to this server.

Methods Summary

connect()

Connect to the server.

disconnect()

Disconnect from the server.

parse_reply(reply)

Return the parsed reply.

send_command(message)

Send a command to server and receive a reply.

Attributes Documentation

connected

Return True if a client is connected to this server.

Returns:
bool

Methods Documentation

async connect()

Connect to the server.

async disconnect()

Disconnect from the server.

Safe to call even if disconnected.

parse_reply(reply)

Return the parsed reply.

Parameters:
replybytes

The reply from the server

Returns:
decoded_messagestr

The decoded and boilerplate stripped string.

async send_command(message)

Send a command to server and receive a reply.

Parameters:
messagestr

The command to send to the server.

Returns:
replybytes

The reply from the server.

Raises:
RuntimeError

Raised if the client is not connected.