socket.onDisconnect not working correctly on desktop devices

Hey @jiangben could you share the code you are using to (1) Connect the socket; (2) Disconnect the socket; and (3) Query the online status of the user?

thanks a lot。
1.

Client = new Client(Scheme, Host, Port, ServerKey, UnityWebRequestAdapter.Instance);
Client.Timeout = 30;
await Client.AuthenticateDeviceAsync(id);
Socket = Client.NewSocket(true);
await Socket .ConnectAsync(session, true);

2.i run game on unity editor ,so disconnect was i stop playing game。

3.query others use ListFriend ,Response => IApiFriend.User.Online

await client.ListFriendsAsync(session)

@jiangben it takes time for the socket to disconnect automatically when exiting play mode in the Unity Editor. You need to disconnect the socket manually prior to shutdown.