Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved UDP socket binding #1

Open
randomPoison opened this issue Sep 7, 2018 · 2 comments
Open

Improved UDP socket binding #1

randomPoison opened this issue Sep 7, 2018 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@randomPoison
Copy link
Member

Currently we require that the application logic manually create and bind a UDP socket and add it to the world as a resource. This gives the user control over what port the socket is bound to, but ultimately exposes UDP as an implementation detail that we don't want to finalize on.

Instead, we should have the EditorSyncSystem create its own UDP socket, and add a way to configure which port it binds to. By default it should let the system decide what port it binds to (by binding to 0.0.0.0:0), but allow the user to specify a different port/address to bind to. It might also be good to allow the user to override the default port via an environment variable.

@randomPoison randomPoison added the enhancement New feature or request label Sep 7, 2018
@randomPoison randomPoison self-assigned this Sep 7, 2018
@randomPoison
Copy link
Member Author

I've setup EditorSyncSystem to automatically create its own UdpSocket and bind it to 0.0.0.0:0 (d87d397), which resolves the most immediate issues. It would still be good to add a couple options for configuring which address the socket binds to, though:

  • An alternate constructor for EditorSyncSystem that allows users to explicitly specify an alternate socket.
  • Detect which socket to use by reading an environment variable.

Both of these should be fairly easy to implement, and I'd be happy to mentor anyone interested in making the contribution 🙂

@randomPoison randomPoison removed their assignment Sep 9, 2018
@randomPoison randomPoison added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 9, 2018
@randomPoison
Copy link
Member Author

Another good thing to let the user configure would be the address the game sends it's data to, i.e. which address the editor is listening on. Currently it's hard-coded to send to 127.0.0.1:8000, which is what the Electron editor is listening on.

@randomPoison randomPoison removed help wanted Extra attention is needed labels Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant