doctor can now disconnect

This commit is contained in:
shinichi
2020-10-19 12:52:35 +02:00
parent d98c32a508
commit 2ecc90ff2c
4 changed files with 14 additions and 15 deletions

View File

@@ -130,6 +130,8 @@ namespace DoctorApp.Utils
expectedMessageLength = BitConverter.ToInt32(totalBuffer, 0);
}
if (ar == null || (!ar.IsCompleted) || (!this.stream.CanRead) || !this.client.Connected)
return;
this.stream.BeginRead(this.buffer, 0, this.buffer.Length, new AsyncCallback(OnRead), null);
}
@@ -192,6 +194,7 @@ namespace DoctorApp.Utils
public void Dispose()
{
Debug.WriteLine("client dispose called");
sendMessage(DataParser.getDisconnectJson(LoginViewModel.Username));
this.stream.Dispose();
this.client.Dispose();
}