private void OnStreamError(object sender, StreamErrorEventArgs e) { if (e.Stream == this) { if (e.Exeption is ProtocolExeption) { this.Close(((ProtocolExeption)e.Exeption).StatusCode); } else { this.Close(StatusCode.InternalError); } } }