public void SendMessage(WebSocketClient ws, int priority) { if (string.IsNullOrEmpty(data)) { var message = new SocketMessage(this, priority); message.Send(ws); sendcount++; // Log.Information("SendMessage(" + id + " / " + sendcount + ") " + command); return; } var messages = data.Split(ws.websocket_package_size).ToArray(); if (command != "pong") { Log.Network("Send (" + messages.Length.ToString() + ") " + command + " / " + data); } for (var i = 0; i < messages.Length; i++) { var message = new SocketMessage(this, messages[i], messages.Length, i, priority); message.Send(ws); } sendcount++; // Log.Information("SendMessage(" + id + " / " + sendcount + ") " + command); // new Task(() => { ws.ProcessQueue(); }); _ = ws.ProcessQueue(); // }
public void SendMessage(WebSocketClient ws) { if (string.IsNullOrEmpty(data)) { var message = new SocketMessage(this); message.Send(ws); return; } var messages = data.Split(4096).ToArray(); Log.Verbose("Send (" + messages.Length.ToString() + ") " + command + " / " + data); for (var i = 0; i < messages.Length; i++) { var message = new SocketMessage(this, messages[i], messages.Length, i); message.Send(ws); } // new Task(() => { ws.ProcessQueue(); }); _ = ws.ProcessQueue(); // }