mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
430 B
18 lines
430 B
14 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
|
||
|
var TCP = process.binding('tcp_wrap').TCP;
|
||
12 years ago
|
var uv = process.binding('uv');
|
||
14 years ago
|
|
||
|
var handle = new TCP();
|
||
|
|
||
|
// Should be able to bind to the common.PORT
|
||
12 years ago
|
var err = handle.bind('0.0.0.0', common.PORT);
|
||
|
assert.equal(err, 0);
|
||
14 years ago
|
|
||
14 years ago
|
// Should not be able to bind to the same port again
|
||
12 years ago
|
err = handle.bind('0.0.0.0', common.PORT);
|
||
|
assert.equal(err, uv.UV_EINVAL);
|
||
14 years ago
|
|
||
14 years ago
|
handle.close();
|