How to properly remotely shut down Unium #106
Replies: 1 comment 2 replies
-
There are start and stop server functions on the Unium component, which will be called automatically when the component is enabled and disabled. Stopping the server closes the listening socket and any in-flight requests should respond with a 500 Internal Server error. Unium is multithreaded so the response should work in parallel to the listener shutting down. If the thread pool is being restarted as part of the restart then it's possible the worker threads are abnormally killing the client socket before the data is sent and the connection closed. It's also possible there's a bug as closing down the server hasn't been extensively tested :) It would require some investigation. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a "restartApp" function that shuts down all gameobjects and reloads the main scene. This causes Unium to throw a bunch of http/socket errors for in-flight requests. How could I properly shut down the server (from a web hook or remotely called component function), before restarting the app?
Beta Was this translation helpful? Give feedback.
All reactions