From: Curt Sampson Date: 2007-11-29T12:45:37+09:00 Subject: Re: Custom Protocol On 2007-11-29 12:18 +0900 (Thu), thefed wrote: > On Nov 28, 2007, at 6:55 PM, Curt Sampson wrote: > > >Typically, protocols have state. So I'd start with as clear an > >expression of the protocol state machine as you can generate, and then > >see about twisting it into a DSL that can be implemented in Ruby. > > What do you mean by state machine? http://en.wikipedia.org/wiki/State_machine For a typical protocol, you might have states such as: - Idle - Sent start message, waiting for response - Connection running but idle - Message sent, waiting for response, And you'd move between various states based on the packets you send. I will send you (off-list) an example of a state machine described in a DSL embedded in Ruby. cjs -- Curt Sampson +81 90 7737 2974 Starling Software Mobile sites and software consulting: http://www.starling-software.com