Skip to content

SocketServer throws RuntimeException if already listening on this port #324

@valzargaming

Description

@valzargaming

* @throws \RuntimeException if listening on this address fails (already in use etc.)

I am uncertain if a workaround is available for this as I haven't dove deeper into this repository, however I have a niche use-case where I have a game server running in another process which outputs http requests as webhooks to my instance of SocketServer. If the SocketServer goes offline at any point the game server which is making the calls to the SocketServer does not stop listening on whatever port the SocketServer was previously listening on, so if the SocketServer tries to restart it will fail to do so as it will be unable to rebind to the port.

This issue could be avoided when using a traditional Socket by simply utilizing the SO_REUSEPORT constant with socket_get_option, but so far I have not seen a way to do this with react/socket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions