Ejemplo n.º 1
0
        private static void SendCompleted(SocketAsyncEventArgs e, SocketAwaitable awaitable)
        {
            // Clear buffer(s) to prevent the SetBuffer buffer and BufferList from both being
            // set for the next write operation. This is unnecessary for reads since they never
            // set BufferList.

            if (e.BufferList != null)
            {
                e.BufferList.Clear();
                e.BufferList = null;
            }
            else
            {
                e.SetBuffer(null, 0, 0);
            }

            awaitable.Complete(e.BytesTransferred, e.SocketError);
        }