Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

engine.io

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine.io - npm Package Compare versions

Comparing version 0.3.5 to 0.3.7

10

History.md
0.3.7 / 2012-10-21
==================
* package: bumped `engine.io-client`
0.3.6 / 2012-10-21
==================
[skipped]
0.3.5 / 2012-10-14

@@ -3,0 +13,0 @@ ==================

5

lib/socket.js

@@ -79,2 +79,6 @@ /**

if ('open' == this.readyState) {
// Reset ping timeout on any packet, incoming data is a good sign of
// other side's liveness
this.setPingTimeout();
switch (packet.type) {

@@ -86,3 +90,2 @@

this.emit('heartbeat');
this.setPingTimeout();
break;

@@ -89,0 +92,0 @@

7

package.json
{
"name": "engine.io"
, "version": "0.3.5"
, "version": "0.3.7"
, "description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server"

@@ -9,3 +9,4 @@ , "main": "./lib/engine.io"

{ "name": "Eugen Dueck", "web": "https://github.com/EugenDueck" },
{ "name": "Afshin Mehrabani", "web": "https://github.com/afshinm" }
{ "name": "Afshin Mehrabani", "web": "https://github.com/afshinm" },
{ "name": "Christoph Dorn", "web": "https://github.com/cadorn" }
]

@@ -15,3 +16,3 @@ , "dependencies": {

, "ws": "~0.4.21"
, "engine.io-client": "0.3.5"
, "engine.io-client": "0.3.7"
, "base64id": "0.1.0"

@@ -18,0 +19,0 @@ }

@@ -263,3 +263,3 @@ # Engine.IO: the realtime engine

For the client API refer to the
[engine-client](http://github.com/learnboost/engine-client) repository.
[engine-client](http://github.com/learnboost/engine.io-client) repository.

@@ -266,0 +266,0 @@ ## Debug / logging

@@ -20,2 +20,8 @@ /*global eio,listen,request,expect*/

it('should be the same version as client', function(){
expect(eio.protocol).to.be.a('number');
var version = require('../package').version;
expect(version).to.be(require('engine.io-client').version);
});
describe('listen', function () {

@@ -22,0 +28,0 @@ it('should open a http server that returns 501', function (done) {

@@ -227,3 +227,3 @@ /*global eio,eioc,listen,request,expect*/

it('should trigger on client if server does not meet ping timeout', function (done) {
var opts = { allowUpgrades: false, pingInterval: 5, pingTimeout: 5 };
var opts = { allowUpgrades: false, pingInterval: 50, pingTimeout: 30 };
var engine = listen(opts, function (port) {

@@ -378,4 +378,4 @@ var socket = new eioc.Socket('ws://localhost:%d'.s(port));

it('should trigger if a poll request is ongoing and the underlying' +
' socket closes, as in a browser tab close', function ($done) {
it('should trigger if a poll request is ongoing and the underlying ' +
'socket closes, as in a browser tab close', function ($done) {
var engine = listen({ allowUpgrades: false }, function (port) {

@@ -468,4 +468,6 @@ // hack to access the sockets created by node-xmlhttprequest

it('should not trigger early with connection `ping timeout` after post handshake timeout', function (done) {
// First timeout should trigger after `pingInterval + pingTimeout`, not just `pingTimeout`.
it('should not trigger early with connection `ping timeout`' +
'after post handshake timeout', function (done) {
// first timeout should trigger after `pingInterval + pingTimeout`,
// not just `pingTimeout`.
var opts = { allowUpgrades: false, pingInterval: 300, pingTimeout: 100 };

@@ -492,5 +494,7 @@ var engine = listen(opts, function (port) {

it('should not trigger early with connection `ping timeout` after post ping timeout', function (done) {
// Ping timeout should trigger after `pingInterval + pingTimeout`, not just `pingTimeout`.
var opts = { allowUpgrades: false, pingInterval: 300, pingTimeout: 100 };
it('should not trigger early with connection `ping timeout` ' +
'after post ping timeout', function (done) {
// ping timeout should trigger after `pingInterval + pingTimeout`,
// not just `pingTimeout`.
var opts = { allowUpgrades: false, pingInterval: 80, pingTimeout: 50 };
var engine = listen(opts, function (port) {

@@ -515,9 +519,11 @@ var socket = new eioc.Socket('ws://localhost:%d'.s(port));

done();
}, 300);
}, 100);
});
});
it('should trigger early with connection `transport close` after missing pong', function (done) {
// Ping timeout should trigger after `pingInterval + pingTimeout`, not just `pingTimeout`.
var opts = { allowUpgrades: false, pingInterval: 300, pingTimeout: 100 };
it('should trigger early with connection `transport close` ' +
'after missing pong', function (done) {
// ping timeout should trigger after `pingInterval + pingTimeout`,
// not just `pingTimeout`.
var opts = { allowUpgrades: false, pingInterval: 80, pingTimeout: 50 };
var engine = listen(opts, function (port) {

@@ -539,5 +545,5 @@ var socket = new eioc.Socket('ws://localhost:%d'.s(port));

setTimeout(function() {
expect(clientCloseReason).to.be("transport close");
expect(clientCloseReason).to.be('transport close');
done();
}, 150);
}, 100);
});

@@ -548,3 +554,4 @@ });

it('should trigger with connection `ping timeout` after `pingInterval + pingTimeout`', function (done) {
it('should trigger with connection `ping timeout` ' +
'after `pingInterval + pingTimeout`', function (done) {
var opts = { allowUpgrades: false, pingInterval: 30, pingTimeout: 10 };

@@ -732,2 +739,37 @@ var engine = listen(opts, function (port) {

});
it('should interleave with pongs if many messages buffered ' +
'after connection open', function (done) {
this.slow(4000);
this.timeout(8000);
var opts = {
transports: ['websocket'],
pingInterval: 200,
pingTimeout: 100
};
var engine = listen(opts, function (port) {
var messageCount = 100;
var messagePayload = new Array(1024 * 1024 * 1).join('a');
var connection = null;
engine.on('connection', function (conn) {
connection = conn;
});
var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
socket.on('open', function () {
for (var i=0;i<messageCount;i++) {
// connection.send('message: ' + i); // works
connection.send(messagePayload + '|message: ' + i); // does not work
}
var receivedCount = 0;
socket.on('message', function (msg) {
receivedCount += 1;
if (receivedCount === messageCount) {
done();
}
});
});
});
});
});

@@ -734,0 +776,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc