Beispiel #1
0
 private void receiveUpdate()
 {
     while (true)
     {
         string data = NetworkCommunication.ReadMessage(tcpClient);
         doctor.patients = JsonConvert.DeserializeObject <List <Patient> >(data);
     }
 }
Beispiel #2
0
        private void Handler(object obj)
        {
            TcpClient client = obj as TcpClient;

            while (true)
            {
                string   data  = NetworkCommunication.ReadMessage(client);
                string[] param = data.Split('|');
                Console.WriteLine($"received: {data}");
                switch (param[0])
                {
                case "1":
                    Patient patient = JsonConvert.DeserializeObject <Patient>(param[1]);
                    AddPatientSession(patient);
                    break;

                case "2":
                    NetworkCommunication.SendPatients(client, patients);
                    break;
                }
            }
        }