Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
-
CI results over the last 21 days12,636Runs99.96%Pass3Failures2Timeouts0Crashes0Skips
Runs with issues per day (up to 0.2%) Oct 21Nov 10- Failures
- Timeouts
- Manifest: netwerk/test/unit/xpcshell.toml
// Opening a second listening socket on the same address as an extant
// socket should elicit NS_ERROR_SOCKET_ADDRESS_IN_USE.
"use strict";
var CC = Components.Constructor;
const ServerSocket = CC(
"@mozilla.org/network/server-socket;1",
"nsIServerSocket",
"init"
);
function testAddrInUse() {
// Create listening socket:
// any port (-1), loopback only (true), default backlog (-1)
let listener = ServerSocket(-1, true, -1);
Assert.ok(listener instanceof Ci.nsIServerSocket);
// Try to create another listening socket on the same port, whatever that was.
do_check_throws_nsIException(
() => ServerSocket(listener.port, true, -1),
"NS_ERROR_SOCKET_ADDRESS_IN_USE"
);
}
function run_test() {
testAddrInUse();
}