Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }