Example #1
0
        public void Write(ArraySegment<byte> buffer, Action<Exception, object> callback, object state)
        {
            //TODO: need buffering that works
            var copy = new byte[buffer.Count];
            Array.Copy(buffer.Array, buffer.Offset, copy, 0, buffer.Count);
            buffer = new ArraySegment<byte>(copy);

            KestrelTrace.Log.ConnectionWrite(0, buffer.Count);
            var req = new ThisWriteReq();
            req.Init(_thread.Loop);
            req.Contextualize(this, _socket, buffer, callback, state);
            req.Write();
        }
Example #2
0
        public void Write(ArraySegment <byte> buffer, Action <Exception, object> callback, object state)
        {
            //TODO: need buffering that works
            var copy = new byte[buffer.Count];

            Array.Copy(buffer.Array, buffer.Offset, copy, 0, buffer.Count);
            buffer = new ArraySegment <byte>(copy);

            KestrelTrace.Log.ConnectionWrite(0, buffer.Count);
            var req = new ThisWriteReq();

            req.Init(_thread.Loop);
            req.Contextualize(this, _socket, buffer, callback, state);
            req.Write();
        }