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

Refresh button doesn't close out network connections #63760

Open
nicholasrobertm opened this issue Aug 1, 2022 · 4 comments
Open

Refresh button doesn't close out network connections #63760

nicholasrobertm opened this issue Aug 1, 2022 · 4 comments

Comments

@nicholasrobertm
Copy link

Godot version

4.0 latest

System information

Windows 10

Issue description

Very Minor thing I saw and wasn't sure if it was a bug or not, when using the high-level multi-player and having a client connected to a server, if you use the 'restart' button connections to that server aren't terminated during the reload. Eventually these connections will timeout but it can cause unexpected behavior.

Steps to reproduce

  1. Create a client > server application, have the server output when clients connect / disconnect via signals.
  2. Hit the refresh / reload button in the godot editor on the server.

Minimal reproduction project

No response

@Chaosus Chaosus added this to the 4.0 milestone Aug 1, 2022
@Chaosus Chaosus moved this to To Assess in 4.x Priority Issues Aug 1, 2022
@akien-mga
Copy link
Member

akien-mga commented Aug 1, 2022

I believe this may not be a bug. I assume you refer to the button that restarts the running instance from the editor, and if so it just closes the process as if you were closing the window or press Alt+F4.

I'm not familiar with the new Multiplayer API but if you initiated the connections manually, you are probably expected to terminate them too - so you can do it e.g. in _exit_tree to make sure that connections are terminated properly when quitting.

On the other hand if the Multiplayer API initiates those connections automatically it could indeed be expected to terminate them automatically on close too.

Cc @Faless

Edit: didn't mean to close, misclick.

Repository owner moved this from To Assess to Done in 4.x Priority Issues Aug 1, 2022
@akien-mga akien-mga reopened this Aug 1, 2022
@akien-mga akien-mga moved this from Done to To Assess in 4.x Priority Issues Aug 1, 2022
@Calinou
Copy link
Member

Calinou commented Aug 1, 2022

I assume you refer to the button that restarts the running instance from the editor, and if so it just closes the process as if you were closing the window or press Alt+F4.

The editor debugger uses OS::kill() to stop the game process, so there is no way for the project to catch it.

@akien-mga
Copy link
Member

akien-mga commented Aug 1, 2022

I assume you refer to the button that restarts the running instance from the editor, and if so it just closes the process as if you were closing the window or press Alt+F4.

The editor debugger uses OS::kill() to stop the game process, so there is no way for the project to catch it.

Indeed. If that's a problem for more users we could maybe add an option so that the Stop / Restart buttons actually send a quit request to the running instance instead of kill. That would potentially be slower but might be useful in cases like this one.

If it's mostly useful for networked apps, it could be part of godotengine/godot-proposals#522 (comment) among advanced run options.

@nicholasrobertm
Copy link
Author

I assume you refer to the button that restarts the running instance from the editor, and if so it just closes the process as if you were closing the window or press Alt+F4.

The editor debugger uses OS::kill() to stop the game process, so there is no way for the project to catch it.

Indeed. If that's a problem for more users we could maybe add an option so that the Stop / Restart buttons actually send a quit request to the running instance instead of kill. That would potentially be slower but might be useful in cases like this one.

If it's mostly useful for networked apps, it could be part of godotengine/godot-proposals#522 (comment) among advanced run options.

Yep this makes perfect sense. It is a bit of a 'stretch' to call this an issue, again it's only in editor but I think there would be a use for a graceful quit in-editor. I imagine this may be useful when building plugins around the editor as well. Appreciate the response!

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Assess
Development

No branches or pull requests

5 participants