private void receiveFromClient() { while (true) { Thread.Sleep(20); Communication.Communication.IPandMessage receiveMessage = Server.receiveMessage(); if (receiveMessage == null) { continue; } MessageFromClient += "(" + receiveMessage.IP + ")-"; byte[] receiveMessageBytes = receiveMessage.Message.ToArray(); foreach (byte item in receiveMessageBytes) { MessageFromClient += "[" + item + "]"; } MessageFromClient += "\r\n"; } }
public void RecieveVCSCommands() { while (true) { try { //Waiting here until we get a response from VCS. var response = serverForVcs.receiveMessage(); if (response == null) { continue; } //Save the response byte[] in the queue var responseMesage = response.Message.ToArray(); _vcsRxQueue.Add(responseMesage); } catch (Exception e) { e.WriteLog().SaveToDataBase().Display(); break; } } }