Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Check if the Backend port is blocked #130

Open
xeruf opened this issue Apr 17, 2020 · 4 comments
Open

Check if the Backend port is blocked #130

xeruf opened this issue Apr 17, 2020 · 4 comments
Labels
bug Unexpected behaviour priority Should be immediately addressed

Comments

@xeruf
Copy link
Member

xeruf commented Apr 17, 2020

    this.backend = portfinder.getPortPromise({ port: 12000 })
      .then((port) => {
        return new Backend(port)
      })

This code assumes that port 12000 is open and doesn't even catch potential errors. If the port is blocked the GUI simply shows a whitescreen when trying to start a game without further information.

@xeruf xeruf added bug Unexpected behaviour priority Should be immediately addressed labels Apr 17, 2020
@Yasamato
Copy link
Contributor

We don't have an fallback-strategie as far as I can see, so should we introduce some changes to our port-handling like saying we have default 12000 and if blocked, server will try to listen on 12001. If this is blocked/used aswell, we increment till 12010 or something like that.

I think this could be quite resonable regarding the needed effort to implement this.

Yasamato added a commit that referenced this issue Apr 17, 2020
@xeruf
Copy link
Member Author

xeruf commented Apr 17, 2020

Nein, der Server läuft auf 13050 und das Backend auf 12000, dass du das nach so langer Zeit in der Entwicklung noch nicht weißt ist beängstigend ^^ wir müssen das echt noch besser dokumentieren.

Aber scheinbar returned portfinder.getPortPromise sowieso den nächsten freien Port, das sollten wir mal anschauen - aber so oder so sollten Promise errors gehändelt werden.

@SKoschnicke
Copy link
Contributor

portfinder sollte eigentlich einen freien Port finden. Die angegebenen Ports sind nur die Startpunkte für die Suche https://www.npmjs.com/package/portfinder

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Unexpected behaviour priority Should be immediately addressed
Projects
None yet
Development

No branches or pull requests

3 participants