public static void Connection_read(IAsyncResult ar) { try { Read = new StreamReader(TCP.GetStream()); MSG?.Invoke(Read.ReadLine()); TCP.GetStream().BeginRead(new byte[] { 0 }, 0, 0, new AsyncCallback(Connection_read), null); } catch { Thread.Sleep(1000); try { TCP.Close(); } catch { } //connect(); } }