/// <summary> /// Sends the specified data. /// </summary> /// <param name="someBytes">The data.</param> /// <param name="raw">whether or not to send raw data</param> /// <param name="close">if set to <c>true</c> [close].</param> public void Send(byte[] someBytes, bool raw = false) { if (raw) { Context.Connection.Client.Send(someBytes); } else { var dataFrame = new DataFrame(someBytes, WebSocketOpCode.Binary); Context.Connection.Client.Send(dataFrame.ToBytes()); } }
/// <summary> /// Sends the specified data. /// </summary> /// <param name="dataFrame">The data.</param> /// <param name="raw">Whether or not to send raw data</param> /// <param name="close">if set to <c>true</c> [close].</param> public void Send(DataFrame dataFrame, bool close = false) { Context.Connection.Client.Send(dataFrame.ToBytes()); }