示例#1
0
        private void EndRead(IAsyncResult ar, CommandStreams state)
        {
            var read = state.StreamReader.EndRead(ar);

            if (read > 0)
            {
                state.StreamWriter.BeginWrite(state.Buffer, 0, read, __EndWrite, state);
            }
            else
            {
                CommandThreads.Run(() => Completing(state));
            }
        }
示例#2
0
 private void Completing(CommandStreams state)
 {
     try
     {
         var ms = state.StreamWriter as MemoryStream;
         if (ms != null)
         {
             Result = Je.bin.MemToObj <T>(ms, _encoding);
         }
         state.Dispose();
         EndExecuteEvent(Je.cmd.EmptyEventArgs(this));
     }
     catch (Exception e)
     {
         state.Dispose();
         Finalize(e);
     }
 }
示例#3
0
 private void EndWrite(IAsyncResult ar, CommandStreams state)
 {
     state.StreamWriter.EndWrite(ar);
     state.Reset();
     state.StreamReader.BeginRead(state.Buffer, 0, state.Buffer.Length, __EndRead, state);
 }