[Twisted-Python] Supporting a two-part client protocol.

Go Luhng goluhng at gmail.com
Thu Feb 6 09:02:40 MST 2020


Thanks for the detailed responses, Colin and Barry. I have a followup
question about sans-io. From the document:

> For input (that is, receiving data from the network), the
calling code is responsible for delivering code to the
implementation via a single input (often via a method called
receive_bytes, or something similar).

This sounds very nice, however with certain protocols, you canonly
decode serialized events based on context.

For example, the parser needs to know if we're at the handshake stage,
or the regular communication stage, or the shutdown stage, because
different formats of messages are sent by the server at each stage.

How does this elegantly fit into the scheme of sans-io?



More information about the Twisted-Python mailing list