private async void WaitForData() { while (true) { int MAX_SIZE = 1024; byte[] buffer = new byte[MAX_SIZE]; int nbytes = await Stream.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false); var chat = ChatPacket.ParsePacket(buffer); ChatUpdate(chat.ToString()); } }