[Twisted-Python] Message sizing design question
fairwinds at eastlink.ca
Mon Jun 5 15:26:12 EDT 2006
I guess I answered myself. Subclassing my base protocol to handle the
marshalling between sending and receiving appears more transparent.
David Pratt wrote:
> Hi. I am trying to decide where to put message sizing for a custom
> protocol. I have set up the connections to be as generic as possible so
> message handling in as much as possible is being done by the connection
> handler that is aware of the connection it is handling at the time.
> There are a few things I need to keep track of at the connection
> (protocol) level such as original handshake and message id's that I am
> tracking per connection, but for the most part, everything else can be
> handled pretty generically by the connection handler.
> In any case, where to deal with message sizing? My thought was that the
> connection handler should deal with it since it should also be
> responsible for encode and decode of messages. So to process or prepare
> a message size seems like it fits in the connection handler also.
> I realize Banana, for example does sizing in the protocol itself but it
> does not anticipate handing the message off to a handler for such
> things. Anyway, it would be great if someone could confirm my reasoning
> or has some comments on this. Many thanks,
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python