Finding a free port for debugging purposes

  1. Ports randomly start from 9222
  2. Try to find a free port between 9222 and 9222 + max sessions
  3. If port is not assigned and using server sockets check that the port is actually free, return port and add to assigned ports collection
    • If no port found – look for a port in the releasedports collection and using server sockets check that the port is actually free, return port and add to assigned ports collection
    • As part of browser tear down – ports are added to the releasedports collection

Have other questions? Access our full knowledge base!

Verified by MonsterInsights