[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

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

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 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