public void ListenForIncomingData() { byte[] bytes; while (true) { bytes = new byte[4]; int inputSize = ReceiveInputSize(); byte[] receivedData = receiveData(inputSize); int sourcePort = GetSourcePort(receivedData); Console.WriteLine("Recieved from node " + nodeName + "From port " + sourcePort.ToString()); SendingManager.Send(receivedData, nodeName, sourcePort); } }
public void ListenForIncomingData() { byte[] bytes; while (true) { bytes = new byte[4]; int inputSize = ReceiveInputSize(); byte[] receivedData = receiveData(inputSize); int sourcePort = GetSourcePort(receivedData); string timeStamp = CableCloud.GetTimeStamp(); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine(timeStamp + " | Recieved from node " + nodeName + " from port " + sourcePort.ToString()); SendingManager.Send(receivedData, nodeName, sourcePort); } }