get rid of that exception, also this is part of 2.4.2 because fuck you
This commit is contained in:
parent
be119d4ea1
commit
d677aefcff
1 changed files with 5 additions and 3 deletions
|
@ -476,10 +476,12 @@ public class CollabVMClient {
|
|||
/// <summary>
|
||||
/// Send a raw string message over the socket
|
||||
/// </summary>
|
||||
public Task 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,
|
||||
public async Task<bool> SendMsg(string msg)
|
||||
{
|
||||
if (!this._connected) return false;
|
||||
await this.socket.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes(msg)), WebSocketMessageType.Text,
|
||||
true, CancellationToken.None);
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Request a list of VMs from the server.
|
||||
|
|
Loading…
Reference in a new issue