Skip to content

Failure to gracefully exit on failure to bind to port  #4

@m3rchant-man

Description

@m3rchant-man

Description:

When a existing server is already bound to 8080 it fails with console output instead of gracefully exiting.

Actual

We can see this from this log

2025/10/30 10:15:10 Starting OpenChamp server...
2025/10/30 10:15:10 Database tables initialized successfully
2025/10/30 10:15:10 Server is running on :8080
2025/10/30 10:15:10 Game server ports range: 7000-8000
2025/10/30 10:15:10 Server starting on :8080
2025/10/30 10:15:10 Queue processor started
2025/10/30 10:15:10 Server stopped: listen tcp :8080: bind: address already in use

...
[hangs and waits for impossible calls]

Expected

2025/10/30 10:15:10 Starting OpenChamp server...
2025/10/30 10:15:10 Database tables initialized successfully
2025/10/30 10:15:10 Server is running on :8080
2025/10/30 10:15:10 Game server ports range: 7000-8000
2025/10/30 10:15:10 Server starting on :8080
2025/10/30 10:15:10 Queue processor started
2025/10/30 10:15:10 Server stopped: listen tcp :8080: bind: address already in use

[Shuts down]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions