Beispiel #1
0
 void ReadCB(IAsyncResult ares)
 {
     byte [] buffer = (byte [])ares.AsyncState;
     try {
         int nread = stream.EndRead(ares);
         // See if we got at least 1 line
         initial.SetBuffer(buffer, nread);
         initial.ReadRequestData();
         ThreadPool.QueueUserWorkItem(new WaitCallback(RunInternal));
     } catch (Exception e) {
         InitialWorkerRequest.FreeBuffer(buffer);
         HandleInitialException(e);
     }
 }
Beispiel #2
0
 public override void Run(object state)
 {
     initial = new InitialWorkerRequest (stream);
     byte [] buffer = InitialWorkerRequest.AllocateBuffer ();
     stream.BeginRead (buffer, 0, buffer.Length, new AsyncCallback (ReadCB), buffer);
 }
Beispiel #3
0
 public override void Run(object state)
 {
     initial = new InitialWorkerRequest(stream);
     byte [] buffer = InitialWorkerRequest.AllocateBuffer();
     stream.BeginRead(buffer, 0, buffer.Length, new AsyncCallback(ReadCB), buffer);
 }