Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c33c0ce56 | |||
| f693b02743 | |||
| 91f19cb69b | |||
| dcd7c278b6 |
@@ -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,4 +1,4 @@
|
||||
# websocket-driver [](https://travis-ci.org/faye/websocket-driver-node)
|
||||
# websocket-driver [](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
|
||||
|
||||
@@ -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
@@ -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": ""}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user