Ämne:
RE: [dcdev] Re: New Encoding Scheme First
Från:
Fredrik Tolf
Datum:
2003-12-01 7:43
Till:
Direct Connect developers

Zdenek Stangl writes:
> I would like to see particular C/C++ implementation of such
> statement ;) If you know, that message fourcc tag is 4 bytes long
> and that the data length bytes are at positions 5 and 6, what's
> wrong then? First you check the received length against the value
> in header, if it's ok, then you lookup the command by it's fourcc,
> process it and then jump right at the begining of next command if
> there is any... In my opinion it's the same for every single
> command. Correct me if Im wrong.

If you do it that way, yeah. However, since you wanted a word splitter
anyway, I say it's more generic to have the command be part of the
final word array, just like shells and everything else do it. While
your model has packets consisting of three parts (fourcc, length,
data, where the fourcc could just as well be part of the data), my
model only has two elements (length, data). Since the fourcc tags have
the same syntax as the rest of the data anyway, I'd say it's better to
just keep all of it part of the same part of the packet.

That's just my opinion, of course.

Fredrik Tolf

> > -----Original Message-----
> From: Fredrik Tolf [mailto:[email protected]]
> Sent: Monday, December 01, 2003 1:28 PM
> To: Direct Connect developers
> Subject: RE: [dcdev] Re: New Encoding Scheme First
> > > Zdenek Stangl writes:
> >  > - semi-binary header != binary protocol. All I would like to have
>  > is the fourcc AND length at the begining of message. Everything
>  > else remains text-based. With such scheme the debugging is still
>  > simple + the parsing mechanism would be more generic and fast.
> > I forgot to say, IMHO that would make the parsing algorithm less
> generic, since it must treat the command name specially. A generic
> algorithm would treat the command just like any other word in the
> line.
> > Fredrik Tolf
> > -- > DC Developers mailinglist
> http://3jane.ashpool.org/cgi-bin/mailman/listinfo/dcdev
> -- > DC Developers mailinglist
> http://3jane.ashpool.org/cgi-bin/mailman/listinfo/dcdev

-- 
DC Developers mailinglist
http://3jane.ashpool.org/cgi-bin/mailman/listinfo/dcdev