Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test-tcp-wrap dont assume port 80 priveleged'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRawas authored and ry committed Jul 14, 2011
1 parent a13506b commit 876712a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/simple/test-tcp-wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ var TCP = process.binding('tcp_wrap').TCP;

var handle = new TCP();

// Cannot bind to port 80 because of access rights.
var r = handle.bind("0.0.0.0", 80);
assert.equal(-1, r);
console.log(errno);
assert.equal(errno, "EACCESS");

// Should be able to bind to the common.PORT
var r = handle.bind("0.0.0.0", common.PORT);
assert.equal(0, r);

// Should not be able to bind to the same port again
var r = handle.bind("0.0.0.0", common.PORT);
assert.equal(-1, r);
console.log(errno);
assert.equal(errno, "EINVAL");

handle.close();

0 comments on commit 876712a

Please sign in to comment.