wpf sucks v2

This commit is contained in:
Sem van der Hoeven
2020-10-13 14:15:38 +02:00
parent fd3b926316
commit 245130a648
5 changed files with 18 additions and 6 deletions

View File

@@ -22,11 +22,13 @@ namespace Client
public Client()
{
this.tcpClient = new TcpClient();
Debug.WriteLine("Starting connect to server");
tcpClient.BeginConnect("localhost", Port, new AsyncCallback(OnConnect), null);
}
private void OnConnect(IAsyncResult ar)
{
Debug.Write("finished connecting to server");
this.tcpClient.EndConnect(ar);
this.stream = tcpClient.GetStream();
this.stream.BeginRead(buffer, 0, buffer.Length, new AsyncCallback(OnReadComplete),null);