public void Validate()
{
SocketError socketError = this.SocketError;
if (socketError != SocketError.Success)
{
throw new SocketException((int) socketError);
}
}
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(); }