How to Send File to SignalR hub From websocket-sharp Client?
<p>We are using the websocket-sharp in one of our applications which establishes a websocket connection with our SignalR Hub on the server, we are able to send the text messages and receive the response for the same but unable to post a <code>byte[]</code>.</p>

<p>Code for sending text to server is this: </p>

<pre><code>public void TestGroupData(string groupname)
{
    DataCarrier dataCarrier = new DataCarrier()
    {
        H = "BILHub",
        M = "GetAllGroupsFor",
        A = new string[] { groupname }
    };
    string wsPacket = JsonConvert.SerializeObject(payLoad);
    this._ws.Send(wsPacket);
    //this.MakeServerCall(dataCarrier);
}
</code></pre>

<p>When we try to send <code>byte[]</code> using the below code, its not going through:</p>

<pre><code>public void TestFileData()
{
    try
    {
        // Read the file data
        Console.WriteLine("Started reading file");
        string fileName = @"C:\Saurabh\Data\Song.mp3";
        byte[] file = File.ReadAllBytes(fileName);
        DataCarrier dataCarrier = new DataCarrier()
        {
            H = "BILHub",
            M = "SendFile",
            A = new object[] { file }
        };
        string wsPacket = JsonConvert.SerializeObject(dataCarrier);
        this._ws.SendAsync(file , OnSendComplete);
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex);
        //throw;
    }
}
</code></pre>

<p>Any help with this? How can I set my hub name in <code>_ws.sendAsync()</code>?</p>