mirror of https://github.com/quasar/Quasar.git
More fixes
This commit is contained in:
parent
261dff32a9
commit
5b54dcb52f
|
@ -118,7 +118,6 @@ public void Connect(string host, ushort port)
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.ToString());
|
||||
OnClientFail(ex);
|
||||
Disconnect();
|
||||
}
|
||||
|
@ -304,6 +303,8 @@ public void Disconnect()
|
|||
_handle.Close();
|
||||
_readOffset = 0;
|
||||
_writeOffset = 0;
|
||||
_readableDataLen = 0;
|
||||
_payloadLen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,17 +16,6 @@ namespace xServer.Core
|
|||
{
|
||||
public class Client
|
||||
{
|
||||
public event ClientFailEventHandler ClientFail;
|
||||
public delegate void ClientFailEventHandler(Client s, Exception ex);
|
||||
|
||||
private void OnClientFail(Exception ex)
|
||||
{
|
||||
if (ClientFail != null)
|
||||
{
|
||||
ClientFail(this, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public event ClientStateEventHandler ClientState;
|
||||
public delegate void ClientStateEventHandler(Client s, bool connected);
|
||||
|
||||
|
@ -296,6 +285,8 @@ public void Disconnect()
|
|||
_handle.Close();
|
||||
_readOffset = 0;
|
||||
_writeOffset = 0;
|
||||
_readableDataLen = 0;
|
||||
_payloadLen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,12 @@ public void Disconnect()
|
|||
while (_clients.Count != 0)
|
||||
{
|
||||
_clients[0].Disconnect();
|
||||
//_clients.RemoveAt(0);
|
||||
try
|
||||
{
|
||||
_clients.RemoveAt(0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue