private void RemotingClient_ConnectionException(object sender, EventArgs<Exception> e)
{
StringBuilder status = new StringBuilder();
TcpClient tcpClient;
TlsClient tlsClient;
status.AppendFormat("Exception during connection attempt: {0}", e.Argument.Message);
status.AppendLine();
status.AppendLine();
UpdateStatus(UpdateType.Alarm, "{0}", status.ToString());
tlsClient = m_remotingClient as TlsClient;
if ((object)tlsClient != null)
{
tlsClient.NetworkCredential = null;
}
else
{
tcpClient = m_remotingClient as TcpClient;
if ((object)tcpClient != null)
tcpClient.NetworkCredential = null;
}
}