mirror of https://github.com/lukechilds/node.git
koichik
14 years ago
committed by
Ryan Dahl
2 changed files with 29 additions and 2 deletions
@ -0,0 +1,27 @@ |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
var net = require('net'); |
|||
|
|||
process.stdin.destroy(); |
|||
|
|||
var accepted = null; |
|||
var server = net.createServer(function(socket) { |
|||
console.log('accepted'); |
|||
accepted = socket; |
|||
socket.end(); |
|||
server.close(); |
|||
}); |
|||
|
|||
|
|||
server.listen(common.PORT, function() { |
|||
console.log('listening...'); |
|||
assert.equal(server.fd, 0); |
|||
|
|||
net.createConnection(common.PORT); |
|||
}); |
|||
|
|||
|
|||
process.on('exit', function() { |
|||
assert.ok(accepted); |
|||
}); |
|||
|
Loading…
Reference in new issue