public void WaitForPackage() { while (true) { try { SocketToForward.Receive(bufferForPacket); Package package = Package.returnToPackage(bufferForPacket); Console.WriteLine("[" + DateTime.UtcNow.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture) + "] " + "I received package at port: " + package.Port); package.printInfo(); ForwardPacket(bufferForPacket); } catch (Exception e) { Console.WriteLine(e); throw; } } }
public void WaitForPackage() { while (true) { try { SocketToForward.Receive(bufferForPacket); DataStream dataStream = DataStream.toData(bufferForPacket); Console.WriteLine(this.Name + ": [" + DateTime.UtcNow.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture) + "] " + "I received package at port: " + dataStream.currentPort); // data.printInfo(); ForwardPacket(bufferForPacket); } catch (Exception e) { Console.WriteLine(e); throw; } } }