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(); // }
public void SendMessage(WebSocketClient ws) { if (string.IsNullOrEmpty(data)) { var message = new SocketMessage(this); message.Send(ws); 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); message.Send(ws); } // new Task(() => { ws.ProcessQueue(); }); _ = ws.ProcessQueue(); // }
public void Send(WebSocketClient ws) { ws.PushMessage(this); }