Пример #1
0
 public void BeginRead(ConnectionContext connectionContext)
 {
     InputStreamContext ctx = new InputStreamContext(connectionContext, bufferSize);
     ctx.ConnectionContext.ClientStream.BeginRead(ctx.Header, 0, sizeof(long), BeginReadCallback, ctx);
 }
Пример #2
0
 private void ProcessRequest(InputStreamContext ctx)
 {
     lock (ctx.ConnectionContext)
         ctx.ConnectionContext.InputQueue.Enqueue(ctx);
     BeginRead(ctx.ConnectionContext);
 }
Пример #3
0
 private void ReadChunk(InputStreamContext ctx)
 {
     int bytesToRead = ctx.RemainingBytes > ctx.Buffer.Length ? ctx.Buffer.Length : (int)ctx.RemainingBytes;
     ctx.ConnectionContext.ClientStream.BeginRead(ctx.Buffer, 0, bytesToRead, BeginReadCallback, ctx);
 }
Пример #4
0
 private void EnqueueEmptyHeader(InputStreamContext ctx)
 {
     Log.LogMessage("Writing empty header");
     InputStreamContext inputContext = new InputStreamContext(ctx.ConnectionContext, bufferSize);
     inputContext.EmptyResponse = true;
     ctx.ConnectionContext.InputQueue.Enqueue(inputContext);
 }