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)); }
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)); }