Example #1
0
            private IEnumerator <object> SendResponseTask(ArraySegment <byte> payload)
            {
                ContentLength = payload.Count;

                if (!HeadersSent)
                {
                    HeadersSent = true;
                    yield return(SendHeadersTask());
                }

                ResponseSent = true;
                yield return(Adapter.Write(payload.Array, payload.Offset, payload.Count));
            }
Example #2
0
File: IO.cs Project: sq/Libraries
 private SignalFuture Flush(int numChars)
 {
     if (numChars > 0)
     {
         _BufferCount = 0;
         int numBytes = _Encoder.GetBytes(_WriteBuffer, 0, numChars, _SendBuffer, 0, true);
         return(_DataWriter.Write(_SendBuffer, 0, numBytes));
     }
     else
     {
         return(SignalFuture.Signaled);
     }
 }
 public SignalFuture Write(byte[] buffer, int offset, int count)
 {
     return(Writer.Write(buffer, offset, count));
 }