Hi Matt, 2009/1/7 Matt <matt.hamm...@rd.bbc.co.uk> > > I think you're right - I'm pretty sure we don't have any components > that provide quite what you're after. But they don't sound too > difficult to write.
I ended up writing my own framer and deframer. It's not too difficult, just error prone. > With your mention of bits, do I take it you're after conveying binary, > rather than textual payloads? (eg. payloads that might contain byte > values equivalent to characters such as newline) > Would I also be right in guessing that you intend to pass these > messages across a TCP connection, rather than as UDP packets? If > either of these is the case, then the Framer and DeFramer components > you spotted won't be up to the job, even if you did add dummy tag > values. Ahh yes, Framer uses newlines for its own purposes! My framer simply prepends each message with a length and reads that many octets from the socket before passing the message up. So I should be ok now. > That said, I think it is perfectly reasonable to use the DataChunker > and DataDeChunker components in the manner you describe - by sending a > sync sequence immediately after a message to flush it through the > dechunker. The other thing to consider is that you wouldn't actually > need to frame the payload by prefixing it with its size - since the > sync bytes delimit it. Probably would need a few extra components > writing to achieve this though (or the creation of modified versions > of DataChunker and DataDeChunker) That is true. I think I got a little bit put off by Michael's comments which sort of indicated that the components weren't being actively maintained at the moment (this is probably just my misconception). Also, it seems a bit yucky to me to flush after each message even if it isn't such a big deal. In any case I've written my own framer which was very easy to do within the Kamaelia framework. I haven't tested it properly at all so it is probably horribly broken ;-) > Matt -- ! Lauri --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "kamaelia" group. To post to this group, send email to kamaelia@googlegroups.com To unsubscribe from this group, send email to kamaelia+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/kamaelia?hl=en -~----------~----~----~----~------~----~------~--~---