Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions websocket-sharp/WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,33 @@ public void Send (byte[] data)

send (Opcode.Binary, new MemoryStream (data));
}

/// <summary>
/// Sends binary <paramref name="data"/> using the WebSocket connection.
/// </summary>
/// <param name="data">
/// An array of <see cref="byte"/> that represents the binary data to send.
/// </param>
/// <param name="index">
/// Start index for reading array <see cref="data"/>.
/// </param>
/// <param name="count">
/// Number of elements in <see cref="data"/> array to send.
/// </param>
public void Send (byte[] data, int index, int count)
{
var msg = _readyState.CheckIfAvailable (false, true, false, false) ??
CheckSendParameter (data);

if (msg != null) {
_logger.Error (msg);
error ("An error has occurred in sending data.", null);

return;
}

send (Opcode.Binary, new MemoryStream (data, index, count));
}

/// <summary>
/// Sends the specified <paramref name="file"/> as binary data using the WebSocket connection.
Expand Down