Compare commits

...

4 Commits

Author SHA1 Message Date
James Coglan 1c33c0ce56 Bump version to 0.3.6. 2014-10-04 08:30:43 +01:00
James Coglan f693b02743 Merge pull request #8 from meteor/close-before-start
driver.close() before driver.start() should close
2014-09-07 21:29:25 +01:00
James Coglan 91f19cb69b Use the SVG build status icon from Travis. 2014-09-07 21:06:45 +01:00
David Glasser dcd7c278b6 driver.close() before driver.start() should close 2014-08-15 10:48:30 -07:00
5 changed files with 15 additions and 3 deletions
+4
View File
@@ -1,3 +1,7 @@
### 0.3.6 / 2014-10-04
* It is now possible to call `close()` before `start()` and close the driver
### 0.3.5 / 2014-07-06
* Don't hold references to frame buffers after a message has been emitted
+1 -1
View File
@@ -1,4 +1,4 @@
# websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-node.png)](https://travis-ci.org/faye/websocket-driver-node)
# websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-node.svg)](https://travis-ci.org/faye/websocket-driver-node)
This module provides a complete implementation of the WebSocket protocols that
can be hooked up to any I/O stream. It aims to simplify things by decoupling
+1 -1
View File
@@ -209,7 +209,7 @@ var instance = {
reason = reason || '';
code = code || this.ERRORS.normal_closure;
if (this.readyState === 0) {
if (this.readyState <= 0) {
this.readyState = 3;
this.emit('close', new Base.CloseEvent(code, reason));
return true;
+1 -1
View File
@@ -5,7 +5,7 @@
, "keywords" : ["websocket"]
, "license" : "MIT"
, "version" : "0.3.5"
, "version" : "0.3.6"
, "engines" : {"node": ">=0.4.0"}
, "main" : "./lib/websocket/driver"
, "devDependencies" : {"jstest": ""}
+8
View File
@@ -50,6 +50,14 @@ test.describe("Client", function() { with(this) {
assertEqual( null, driver().getState() )
}})
describe("close", function() { with(this) {
it("changes the state to closed", function() { with(this) {
driver().close()
assertEqual( "closed", driver().getState() )
assertEqual( [1000, ''], close )
}})
}})
describe("start", function() { with(this) {
it("writes the handshake request to the socket", function() { with(this) {
expect(driver().io, "emit").given("data", buffer(