|
|
@ -29,6 +29,7 @@ var conns = 0, conns_closed = 0; |
|
|
|
var server = net.createServer(function(socket) { |
|
|
|
conns++; |
|
|
|
assert.equal('127.0.0.1', socket.remoteAddress); |
|
|
|
assert.equal('IPv4', socket.remoteFamily); |
|
|
|
assert.ok(socket.remotePort); |
|
|
|
assert.notEqual(socket.remotePort, common.PORT); |
|
|
|
socket.on('end', function() { |
|
|
@ -42,11 +43,13 @@ server.listen(common.PORT, 'localhost', function() { |
|
|
|
var client2 = net.createConnection(common.PORT); |
|
|
|
client.on('connect', function() { |
|
|
|
assert.equal('127.0.0.1', client.remoteAddress); |
|
|
|
assert.equal('IPv4', client.remoteFamily); |
|
|
|
assert.equal(common.PORT, client.remotePort); |
|
|
|
client.end(); |
|
|
|
}); |
|
|
|
client2.on('connect', function() { |
|
|
|
assert.equal('127.0.0.1', client2.remoteAddress); |
|
|
|
assert.equal('IPv4', client.remoteFamily); |
|
|
|
assert.equal(common.PORT, client2.remotePort); |
|
|
|
client2.end(); |
|
|
|
}); |
|
|
|