#Issue with Clients Stuck in Windows Processes After Server Disconnects in Mirror

28 messages · Page 1 of 1 (latest)

fiery raptor
#

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?

tawdry fulcrum
#
Can you replicate with Mirrors examples, such as tanks?
fiery raptor
#

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.

rigid torrent
#

Override OnStopClient or OnServerDisconnect in Network Manager

fiery raptor
#

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.

rigid torrent
#

What is calling Application.Quit? Mirror is not

fiery raptor
#

I have two applications with Mirror, Server and Client. When the server stops and I close the applications, the processes remain hanging in Windows.

rigid torrent
#

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)

fiery raptor
#

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.

rigid torrent
#

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

tawdry fulcrum
#

headless/dedicated server build clients?
Or editor/actual builds with UI.

fiery raptor
#

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.

rigid torrent
#

That's on Unity then

fiery raptor
#

OnApplicationQuit is also called by the client when the client window is closed.

rigid torrent
#

Mirror isn't doing anything to keep the process alive

fiery raptor
#

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.

tawdry fulcrum
#

Otherwise not sure what to suggest. There something we are not seeing

fiery raptor
#

I can definitely download it and insert it into a new project, could you send me the link directly? to avoid making mistakes?

fiery raptor
#

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!

rigid torrent