void OnEnded(Error error)
{
if (this.heartBeatTimer != null)
{
this.heartBeatTimer.Dispose();
}
if (this.transport != null)
{
this.transport.Close();
}
for (int i = 0; i < this.localSessions.Length; i++)
{
var session = this.localSessions[i];
if (session != null)
{
session.Abort(error);
}
}
this.NotifyClosed(error);
}