Package javaflow.network.impl.speedtest

Source Code of javaflow.network.impl.speedtest.ExpectPackets

package javaflow.network.impl.speedtest;

import javaflow.components.api.Component;
import javaflow.components.api.InputPort;
import javaflow.components.api.OutputPort;
import javaflow.components.api.Packet;

public class ExpectPackets implements Component{
    InputPort in;
    OutputPort endNotify;
    InputPort<Integer> countPort;

    @Override
    public void execute() {
        int count = countPort.receiveContentAndDrop().intValue();
        for(int i = 0; i<count;i++){
            Packet packet = in.receive();
            packet.drop();
        }
        endNotify.createPacket(null).send();
    }
}
TOP

Related Classes of javaflow.network.impl.speedtest.ExpectPackets

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.