mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2168] [CLOSED] serve: refuse a port another program holds on 127.0.0.1, and say which program #3898
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2168
Author: @ByteJuggler
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/port-in-use📝 Commits (2)
958d98ffix(serve): refuse a port another program holds on 127.0.0.1, and say which program93df3c4tests: test_strata_bench's port-owner test finds serve/ when run as a script (tools\test_strata_bench.py)📊 Changes
4 files changed (+161 additions, -5 deletions)
View changed files
📝
serve/server.py(+72 -3)📝
serve/test_server.py(+38 -0)📝
tools/strata_bench.py(+27 -2)📝
tools/test_strata_bench.py(+24 -0)📄 Description
On Windows, Strata on
0.0.0.0:8080could start beside another program holding127.0.0.1:8080(Steam'ssteamwebhelper.exeon some PCs). The server saidready, but every client on the PC (web app, chat.py, coding tools, BENCH) reached the other program. The bench then waited "still loading" for 10 minutes. WithoutSO_EXCLUSIVEADDRUSE, Windows allows a wildcard bind next to another process's specific bind;SO_REUSEADDRwas already off (#769).Changes
Server.server_bind:SO_EXCLUSIVEADDRUSEon Windows. The existing early test bind inmain()now fails before the model loads (checked against a live Steam listener:WinError 10048).--port) and for good (SETUP.bat --port/./setup.sh --setup --port). It is printed without argparse's usage line in front.strata_bench.py: the pre-check counts any listener on the port, not only one that answers/healthwith JSON (Steam answers 404), and names it.Before
After (
--host 0.0.0.0 --port 8080, Steam running)Bench:
Tests
0.0.0.0:Pcannot be bound beside a127.0.0.1:Plistener (fails before this change on Windows), message tests, and bench port-check tests.serve.test_serverpasses (310).tools/has 3 failures intest_setup_engine_hash.WhatARefusalDoesToTheCaller, which fail the same way onmain.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.