Commit Graph

16 Commits

Author SHA1 Message Date
Kevin Roark
ba64f07bca Removed has-binary-data dependency
And replaced it with better isBuf function. Has binary data would not have
checked objects that contain blobs. isBuf only checks the current object,
not its child objects
2014-03-05 00:20:52 -05:00
Kevin Roark
47df0694f5 Fixed the object check in binary.removeBlobs
Remove blobs has to iterate over a javascript object and asynchronously
remove the blobs / files. It does this by iterating over arrays and
objects in the larger object recursively.

Problem was in checking for object to iterate over, wasn't checking if
that object was binary data itself. So it was working, but really slowly,
by iterating over every byte in a Buffer and checking it for blobs.
Much faster now :)
2014-03-04 23:50:36 -05:00
Guillermo Rauch
3283b89c4e Release 2.1.0 2014-03-01 08:32:23 -08:00
Guillermo Rauch
dd4b822426 Merge pull request #4 from kevin-roark/add/class-based-protocol
Protocol is now class-based
2014-02-27 15:09:14 -08:00
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
Guillermo Rauch
101aeabdb8 Merge pull request #3 from kevin-roark/add/new-binary-parsing
A faster and smaller binary parser and protocol
2014-02-27 12:15:10 -08:00
Guillermo Rauch
027c73b91b remove old credentials 2014-02-27 12:14:52 -08:00
Kevin Roark
299849b002 A faster and smaller binary parser and protocol
This is a squash of a few commits. Below is a small summary of commits.

Results from it: before the build size of socket.io-client was ~250K.
Now it is ~215K.
Tests I was doing here
(https://github.com/kevin-roark/socketio-binaryexample/tree/speed-testing)
take about 1/4 - 1/5 as long with this commit compared to msgpack.

The first was the initial rewrite of the encoding, which removes msgpack
and instead uses a sequence of engine.write's for a binary event. The
first write is the packet metadata with placeholders in the json for
any binary data. Then the following events are the raw binary data that
get filled by the placeholders.

The second commit was bug fixes that made the tests pass.

The third commit was removing unnecssary packages from package.json.

Fourth commit was adding nice comments, and 5th commit was merging
upstream.

The remaining commits involved merging with actual socket.io-parser,
rather than the protocol repository. Oops.
2014-02-26 22:31:39 -05:00
Guillermo Rauch
36f8aa8355 updated credentials 2014-02-20 13:56:43 -08:00
Guillermo Rauch
fd1018b92a Merge pull request #1 from rase-/add/zuul
Added zuul config and made testing work on browsers
2014-02-20 13:54:56 -08:00
Tony Kovanen
4e8db59871 Configured npm test 2014-02-20 13:08:04 +02:00
Tony Kovanen
85f8f98699 Added a couple of tests with Blobs for issue #2 2014-02-20 12:39:56 +02:00
Tony Kovanen
42cc5d2cff Added zuul config and made testing work on browsers 2014-02-20 12:18:21 +02:00
Guillermo Rauch
5efe005679 Release 2.0.0 2014-02-19 16:51:16 -08:00
Guillermo Rauch
861b60ef26 package: fix github url 2014-02-19 15:26:55 -08:00
Guillermo Rauch
86725d1e92 moved from socket.io-protocol 2014-02-19 15:26:26 -08:00