internal void OnIoException(Exception exception)
{
Trace.WriteLine(TraceLevel.Error, "I/O: {0}", exception.ToString());
if (this.state != State.End)
{
this.state = State.End;
Error error = new Error() { Condition = ErrorCode.ConnectionForced };
this.OnEnded(error);
}
}