public void FinishWrite(SocketChannelAsyncOperation operation)
{
bool resetWritePending = this.Channel.ResetState(StateFlags.WriteScheduled);
Contract.Assert(resetWritePending);
var input = OutboundBuffer;
try
{
operation.Validate();
var sent = operation.BytesTransferred;
Channel.ResetWriteOperation();
if (sent > 0)
{
input.RemoveBytes(sent);
}
}
catch (Exception ex)
{
input.FailFlushed(ex, true);
throw;
}
// directly call super.flush0() to force a flush now
base.Flush0();
}