public void ForwardPacket(byte[] bytes) { Package package = Package.returnToPackage(bytes); packageHandler.handlePackage(package); SocketToForward.Send(package.convertToBytes()); Console.WriteLine("[" + DateTime.UtcNow.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture) + "] " + "I sent package by port: " + package.Port); package.printInfo(); }
public void ForwardPacket(byte[] bytes) { DataStream dataStream = DataStream.toData(bytes); Console.WriteLine("I received packet"); packageHandler.handlePackage(dataStream); SocketToForward.Send(dataStream.toBytes()); Console.WriteLine(this.Name + ": [" + DateTime.UtcNow.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture) + "] " + "I sent package by port: " + dataStream.currentPort); // dataStream.printInfo(); }