|
@ -22,14 +22,16 @@ |
|
|
var common = require('../common'); |
|
|
var common = require('../common'); |
|
|
var assert = require('assert'); |
|
|
var assert = require('assert'); |
|
|
|
|
|
|
|
|
var Stream = require('net').Stream; |
|
|
var net = require('net'); |
|
|
|
|
|
|
|
|
var s = new Stream(); |
|
|
var s = new net.Stream(); |
|
|
|
|
|
|
|
|
// test that destroy called on a stream with a server only ever decrements the
|
|
|
// test that destroy called on a stream with a server only ever decrements the
|
|
|
// server connection count once
|
|
|
// server connection count once
|
|
|
|
|
|
|
|
|
s.server = { connections: 10 } |
|
|
s.server = new net.Server(); |
|
|
|
|
|
s.server.connections = 10; |
|
|
|
|
|
|
|
|
assert.equal(10, s.server.connections); |
|
|
assert.equal(10, s.server.connections); |
|
|
s.destroy() |
|
|
s.destroy() |
|
|
assert.equal(9, s.server.connections); |
|
|
assert.equal(9, s.server.connections); |
|
|