Streaming & byte[]

Aug 14, 2012 at 10:05 AM

Digging on speed issue I find that the faster way will be using a streaming, in WCF there is such option http://msdn.microsoft.com/en-us/library/ms731913.aspx.

No matter what, I still believe that byte [] will be faster than base64, since sending 30K for sure faster than sending 40K.

My question, is there any support for streaming in super web socket, is there any plans to implement that? (mean stream data to websocket server where it will pass it to web client)

Open stream channel from server app to web socket server will cut the time by 30%.

 

If not, how I can send byte[] to web without been converted base64?!, i will handle the data in my client (web app).

Coordinator
Aug 17, 2012 at 2:39 AM

Actually, TCP always work in Streaming mode. Streaming in WCF is not what you want.

I had told that to you before, SuperWebSocket support binary fragment, you can use NewDataReceived event of the appServer to handle incomming binary data.

Aug 17, 2012 at 7:36 AM
Edited Aug 17, 2012 at 7:47 AM

Thanks for the replay!

Ok I see an example at:

.\SuperWebSocket\Command\Continuation.cs

 

So you suggest to replace:

namespace WebSocketServer.AppServer.Command
{
    public class MYCOC : JsonSubCommand<WebSocketServerSession, MYCORequist>
    {
        protected override void ExecuteJsonCommand(WebSocketServerSession session, MYCORequist commandInfo)
        {
            
        }
    }
}
to something like the Continuation command?

Coordinator
Aug 17, 2012 at 7:38 AM

You needn't check documentaton.

In VS, type a DOT(.) after the appServer instance variable, you can find all methods, all properties and all events which it has.

Jun 28, 2013 at 9:23 AM
Hi,

I am trying to send and received binary buffer data But unfortunately i found "socketServer_SessionClosed" event at global.asax file has been fired and its through "CloseReason" is protocalError.

So please can you guide me regarding this.
At Javascript, My code for sending binary data is

    contexto.drawImage(canvas, 0, 0);
    var image = contexto.getImageData(0, 0, 400, 300);
    var binary_data = new Uint8Array(image.data.length);
    for (var i = 0; i < image.data.length; i++) {
        binary_data[i] = image.data[i];
    }
   ws.send(binary_data.buffer,1,1);

Thank you in advance