Added Try-Catch to Client.Equals

This commit is contained in:
MaxXor 2015-09-01 09:35:56 +02:00
parent 7f013a505e
commit 1e8506470f
1 changed files with 8 additions and 1 deletions

View File

@ -101,9 +101,16 @@ private void OnClientWrite(IPacket packet, long length, byte[] rawData)
/// <param name="c">Client to compare with.</param> /// <param name="c">Client to compare with.</param>
/// <returns></returns> /// <returns></returns>
public bool Equals(Client c) public bool Equals(Client c)
{
try
{ {
return this.EndPoint.Port == c.EndPoint.Port; // this port is always unique for each client return this.EndPoint.Port == c.EndPoint.Port; // this port is always unique for each client
} }
catch (Exception)
{
return false;
}
}
/// <summary> /// <summary>
/// The type of the packet received. /// The type of the packet received.