예제 #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);
 }