attempt to fix double remuser issue

This commit is contained in:
Elijah R 2024-01-03 21:23:21 -05:00
parent 9c985928fe
commit b2dd906b02

View file

@ -75,7 +75,7 @@ public class User
public async Task SendAsync(string msg) public async Task SendAsync(string msg)
{ {
if (socket.State != WebSocketState.Open) if (_disposed || socket.State != WebSocketState.Open)
{ {
return; return;
} }
@ -573,6 +573,8 @@ public class User
} }
public async Task Close(bool sendDisconnect = true) public async Task Close(bool sendDisconnect = true)
{ {
if (_disposed) return;
_disposed = true;
if (sendDisconnect) SendAsync(Guacutils.Encode("disconnect")); if (sendDisconnect) SendAsync(Guacutils.Encode("disconnect"));
try try
{ {