Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/netwerk/test/unit/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 919 B image not shown  

Quelle  test_addr_in_use_error.js   Sprache: JAVA

 
// Opening a second listening socket on the same address as an extant
// socket should elicit NS_ERROR_SOCKET_ADDRESS_IN_USE on non-Windows
// machines.

"use strict";

var CC = Components.Constructor;

const ServerSocket = CC(
  "@mozilla.org/network/server-socket;1",
  "nsIServerSocket",
  "init"
);

function testAddrInUse() {
  // Windows lets us have as many sockets listening on the same address as
  // we like, evidently.
  if (mozinfo.os == "win") {
    return;
  }

  // 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();
}

Messung V0.5
C=85 H=94 G=89

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.