Kevin Roark 5bea0bf41c Protocol is now class-based
Separated the encoding and decoding into two public-facing objects,
Encoder and Decoder.

Both objects take nothing on construction. Encoder has a single method,
encode, that mimics the previous version's function encode (takes a
packet object and a callback). Decoder has a single method too, add, that
takes any object (packet string or binary data). Decoder emits a 'decoded'
event when it has received all of the parts of a packet. The only
parameter for the decoded event is the reconstructed packet.

I am hesitant about the Encoder.encode vs Decoder.add thing. Should it be
more consistent, or should it stay like this where the function names are
more descriptive?

Also, rewrote the test helper functions to deal with new event-based
decoding. Wrote a new test in test/arraybuffer.js that tests for memory
leaks in Decoder as well.
2014-02-27 17:46:20 -05:00
2014-02-27 17:46:20 -05:00
2014-02-19 15:26:26 -08:00
2014-02-19 15:26:26 -08:00
2014-02-19 16:51:16 -08:00
2014-02-27 17:46:20 -05:00
2014-02-27 17:46:20 -05:00
2014-02-19 15:26:26 -08:00
Description
No description provided
Readme MIT 43 MiB
Languages
TypeScript 63.8%
JavaScript 36%