get rid of that exception, also this is part of 2.4.2 because fuck you

This commit is contained in:
Elijah R 2024-04-02 19:28:24 -04:00
parent be119d4ea1
commit d677aefcff

View file

@ -476,10 +476,12 @@ public class CollabVMClient {
/// <summary> /// <summary>
/// Send a raw string message over the socket /// Send a raw string message over the socket
/// </summary> /// </summary>
public Task SendMsg(string msg) { public async Task<bool> SendMsg(string msg)
if (!this._connected) throw new WebSocketException("Cannot send a message while the socket is closed"); {
return this.socket.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes(msg)), WebSocketMessageType.Text, if (!this._connected) return false;
await this.socket.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes(msg)), WebSocketMessageType.Text,
true, CancellationToken.None); true, CancellationToken.None);
return true;
} }
/// <summary> /// <summary>
/// Request a list of VMs from the server. /// Request a list of VMs from the server.