Hello, I am facing an issue with Mirror in Unity. The problem occurs when the server disconnects, and after closing the client windows, all the clients remain stuck in the Windows processes. I am sure that the NetworkManager is calling OnClientDisconnect, but the clients are not properly terminating. How can I resolve this issue?
#Issue with Clients Stuck in Windows Processes After Server Disconnects in Mirror
28 messages · Page 1 of 1 (latest)
Can you replicate with Mirrors examples, such as tanks?
Unity 6000.0.21f1 and Mirror 93.0.0
also if closing gracefully the result is similar
i have 3 application tanks , start server and start other two client. Later stop Server and closing applications . i go into the task manager and the processes are active.
You'd need code in clients to terminate the app when they disconnect...Mirror doesn't do that automatically.
Override OnStopClient or OnServerDisconnect in Network Manager
Maybe you didn’t understand well, or I didn’t express myself clearly.
By implementing this inside:
public override void OnApplicationQuit()
{
OnStopClient();
}
The client stops, but the process remains hanging in Windows.
public override void OnStopClient()
{
base.OnStopClient();
}
What should I do? I don’t know the processes started by Mirror.
When OnApplicationQuit runs, the client stops, but the processes remain hanging in Windows.
For now, I am using Process.GetCurrentProcess().Kill(); to force end the process.
What is calling Application.Quit? Mirror is not
I have two applications with Mirror, Server and Client. When the server stops and I close the applications, the processes remain hanging in Windows.
You'd need something like this
public override void OnStopClient()
{
Application.Quit();
}
and get rid of your OnApplicationQuit above
clients don't know why they got disconnected (server killed)
I don't need to terminate the application, but the process still remains hanging in Windows, even if I use what you're suggesting.
I can also remove it, but the processes remain hanging.
Here's what we understood:
Server starts
one or more clients connect
server stops
clients stay running (disconnected)
OnApplicationQuit on server doesn't do anything for clients
headless/dedicated server build clients?
Or editor/actual builds with UI.
So, I have two builds: a Game Server and a Client.
I start the Server,
I start the Client,
I stop the Server,
the Client stops automatically.
However, when I close the Game windows of the Client, I still find the Client process running in Task Manager, but in reality, there are no active clients.
That's on Unity then
OnApplicationQuit is also called by the client when the client window is closed.
Mirror isn't doing anything to keep the process alive
Thank you for the support, I have the same application with an older version of Mirror, but it doesn't give me this problem, and I have the same new Unity version.
Would you be able to download github version of mirror into a fresh project.
Build and run tanks, play, close the game, no other changes. Similar to what you do now.
Just a rare chance a version you had might have a problem.
Otherwise not sure what to suggest. There something we are not seeing
I can definitely download it and insert it into a new project, could you send me the link directly? to avoid making mistakes?
v95.1.3 fresh off the press
Hello, I wanted to update you. The issue was with Unity, not Mirror. Starting from version 6.0, background processes were not being terminated after the application closed, causing processes to stack up. The solution is to download Unity 6.0.39f1, which resolves everything. Thanks for your support!
Got a link to where they posted a report of fixing this?