From 4a238d920758a90be251f37583864656ae4303f6 Mon Sep 17 00:00:00 2001 From: shinichi Date: Mon, 19 Oct 2020 12:07:00 +0200 Subject: [PATCH] Auto stash before checking out "HEAD" --- DoctorApp/Utils/Client.cs | 4 ++-- DoctorApp/Views/MainView.xaml | 2 +- Server/Client.cs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DoctorApp/Utils/Client.cs b/DoctorApp/Utils/Client.cs index f5fa102..15669b6 100644 --- a/DoctorApp/Utils/Client.cs +++ b/DoctorApp/Utils/Client.cs @@ -111,10 +111,10 @@ namespace DoctorApp.Utils Console.WriteLine("Set resistance identifier"); break; case DataParser.NEW_CONNECTION: - this.MainViewModel.NewConnectedUser(DataParser.getUsernameFromResponseJson(payloadbytes)); + this.MainViewModel.NewConnectedUser(DataParser.getUsernameFromJson(payloadbytes)); break; case DataParser.DISCONNECT: - this.MainViewModel.DisconnectedUser(DataParser.getUsernameFromResponseJson(payloadbytes)); + this.MainViewModel.DisconnectedUser(DataParser.getUsernameFromJson(payloadbytes)); break; default: Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}"); diff --git a/DoctorApp/Views/MainView.xaml b/DoctorApp/Views/MainView.xaml index dc14aee..80cf8c9 100644 --- a/DoctorApp/Views/MainView.xaml +++ b/DoctorApp/Views/MainView.xaml @@ -11,7 +11,7 @@ - + diff --git a/Server/Client.cs b/Server/Client.cs index 74425ef..7a89f5f 100644 --- a/Server/Client.cs +++ b/Server/Client.cs @@ -65,6 +65,8 @@ namespace Server } } + if (ar == null || (!ar.IsCompleted) || (!this.stream.CanRead)) + return; this.stream.BeginRead(this.buffer, 0, this.buffer.Length, new AsyncCallback(OnRead), null); }