summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-06-09 15:31:51 +0200
committerRyan Dahl <ry@tinyclouds.org>2011-06-10 18:17:48 +0200
commit062759194b636ee14f2bb8abb071c49eb2257f6b (patch)
treea4cc97350de302c7f3f53e596219195ab42d3393 /test
parent623f513071ac2551b9812e9d4ebaf482ba535d46 (diff)
downloadnodejs-062759194b636ee14f2bb8abb071c49eb2257f6b.tar.gz
nodejs-062759194b636ee14f2bb8abb071c49eb2257f6b.tar.bz2
nodejs-062759194b636ee14f2bb8abb071c49eb2257f6b.zip
Initial binding to uv_tcp_t
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-tcp-wrap.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/simple/test-tcp-wrap.js b/test/simple/test-tcp-wrap.js
new file mode 100644
index 000000000..32208ef74
--- /dev/null
+++ b/test/simple/test-tcp-wrap.js
@@ -0,0 +1,18 @@
+var common = require('../common');
+var assert = require('assert');
+
+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);
+
+handle.close();