Re: [dcdev] Re: New Encoding Scheme First
2003-12-02 5:41
Direct Connect developers <[email protected]>, "Zdenek Stangl" <[email protected]>

On Tuesday 02 December 2003 00:45, Zdenek Stangl wrote:
> Might I ask what you want the FF FF start word for?

for the case of total data distortion. I think it's always better to have
some 'anchor' for cases, when data goes inconsistent or mangled, than none.

most of binary protocols handling data corruption (PES stream, mp3, ...) has this kind of pattern.

Doing word-splitting for every incomming data on the hub-side isn't really
good idea. For current DC protocol, Im having custom parsing routine for
every single command, looking only for tokens or specific parts that I
really need for the processing. Im also avoiding data copying/moving as
much as possible and believe me, all this has helped to gain performance of
ptokax by approximately 15% in 0.330 version in comparsion with currenlty
available 0.326, which uses string classes and copies data a lot. And
that's just the parsing mechanism. All sockets are in non-blocking mode -
when underlaying tcp kernel wouldblock, im buffering data by myself - no
blocking, no threads.

That's right, I also use this kind of tips on my hub. Without this, you have very bad performance.

There is still something missing in our discussion, to have it
constructive. Try to come out with alternatives, if you can't agree with my
draft, please.

Yes, it is a good idea. Instead of making on poll for a text-based protocol or a binary-based one, why not making a draft of both and proposing it here ?


DC Developers mailinglist