[tpm] delimiting/reading YAML documents across sockets

Uri Guttman uri at stemsystems.com
Mon Jul 8 20:17:27 PDT 2013


On 07/08/2013 10:17 PM, Fulko Hew wrote:

>
> On Mon, Jul 8, 2013 at 7:32 PM, Uri Guttman <uri at stemsystems.com> added:
>
>> you should separate encoding from packeting. you can choose any
>> encoding and then wrap it in a common packet format for sending on
>> the wire. what i did years ago was to create a trivial packet header/trailer.
>
> ... snip ...
>
> That's what I was afraid of.
> Not that its hard, but I would have expected an exchange specification to
> have been included as part of the encoding specification regardless of
> the transport mechanism.
>
> I'll check out IO::YAML, and if not sufficient (or easy to understand) then
> I'll make my own as Uri suggested.  I was prepared to do that, I just
> wasn't expecting to have to (in this day and age).

well, as i said, the two things, encoding and packetizing are very 
different things and shouldn't be in the same module. detecting when a 
packet is recieved can be simple or complex and can require a lot of 
buffering and solid i/o coding. that has nothing to do with an 
encode/decode module. adding cruft like that is what can ruin a good 
module. keep it simple, stupid! :)

thanx,

uri


-- 
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com


More information about the toronto-pm mailing list