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

2020-02-06 Thread Barry Scott
On Thursday, 6 February 2020 16:02:40 GMT Go Luhng wrote: > 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

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

2020-02-06 Thread Go Luhng
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_b

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

2020-02-05 Thread Barry Scott
On Wednesday, 5 February 2020 08:48:41 GMT Colin Dunklau wrote: > I wasn't able to find an example in Twisted of an implicit state > machine. Maybe someone else has a concrete example somewhere? There is an example of an explicit state machine in the twisted code for http chunked transfer encoding

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

2020-02-05 Thread Colin Dunklau
On Tue, Feb 4, 2020 at 6:12 PM Go Luhng wrote: > > Thanks Colin and Barry for the reply. I read the sans-io docs and it > is an attractive approach. > > I believe I have a plan going forward, but I'm not sure what you mean > by explicit vs implicit state machine, if you care to elaborate. I reali

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

2020-02-04 Thread Colin Dunklau
On Tue, Feb 4, 2020 at 6:12 PM Go Luhng wrote: > > Thanks Colin and Barry for the reply. I read the sans-io docs and it > is an attractive approach. > > I believe I have a plan going forward, but I'm not sure what you mean > by explicit vs implicit state machine, if you care to elaborate. IntNStr

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

2020-02-04 Thread Go Luhng
Thanks Colin and Barry for the reply. I read the sans-io docs and it is an attractive approach. I believe I have a plan going forward, but I'm not sure what you mean by explicit vs implicit state machine, if you care to elaborate. ___ Twisted-Python mai

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

2020-02-04 Thread Barry Scott
On Tuesday, 4 February 2020 07:39:11 GMT Colin Dunklau wrote: > On Tue, Feb 4, 2020 at 1:18 AM Go Luhng wrote: > > > Colin Dunklau wrote: > > > > > > Assuming the header has a fixed length, > > > > It does. The header is just a serialized C struct, so it's > > fully-specified for length and offs

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

2020-02-03 Thread Colin Dunklau
On Tue, Feb 4, 2020 at 1:18 AM Go Luhng wrote: > > > Colin Dunklau wrote: > > > > Assuming the header has a fixed length, > > It does. The header is just a serialized C struct, so it's > fully-specified for length and offset of each field. > > > OTOH, that's for stream protocols, so if you want to

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

2020-02-03 Thread Go Luhng
> Colin Dunklau wrote: > > Assuming the header has a fixed length, It does. The header is just a serialized C struct, so it's fully-specified for length and offset of each field. > OTOH, that's for stream protocols, so if you want to eventually handle > UDP, it's probably nicer to do the full san

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

2020-02-03 Thread Colin Dunklau
On Mon, Feb 3, 2020 at 8:06 PM Go Luhng wrote: > > Hi there, > > I'm planning to use Twisted to write a client for the following protocol: > > Each messages is composed of two separate messages: > > 1. A header, which is a serialized C struct, containing multiple > fields, among them a `length` fi

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

2020-02-03 Thread Go Luhng
Hi there, I'm planning to use Twisted to write a client for the following protocol: Each messages is composed of two separate messages: 1. A header, which is a serialized C struct, containing multiple fields, among them a `length` field. 2. A Protocol Buffer payload, which length is specified by