Mirror icon indicating copy to clipboard operation
Mirror copied to clipboard

incremental connection from client

Open Mr-Tin-25 opened this issue 2 years ago • 1 comments

  1. connection a client to a server | StartClient();
  2. stopping client connection | StopClient();
  3. reconnect again || StartClient();

now client will be register twice.

doing 2. & 3. again will try to connect +1 each time.

Reason: every time client gets started AddTransportHandlers() is call and callback are registered. RemoveTransportHandlers() won't be triggered when client stops. => Callback are registered multiple times, that's why client connection increases.

Mr-Tin-25 avatar Apr 29 '22 15:04 Mr-Tin-25

I have the same bug, in the last Mirror Update.

I found that the problem is from a missing call of "OnDisconnected?.Invoke();" in the the Disconnect() method in the class Client of Telepathy, when the client disconnect manually.

So I just added "OnDisconnected?.Invoke();" to the line 255 and it resolve the bug, at least for me.

Helvest avatar May 05 '22 15:05 Helvest

@vis2k see also #3213

MrGadget1024 avatar Nov 24 '22 11:11 MrGadget1024

checking

miwarnec avatar Dec 03 '22 17:12 miwarnec

let's close this in favor of https://github.com/vis2k/Mirror/issues/3213 , one open issue is enough

miwarnec avatar Dec 03 '22 17:12 miwarnec