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();
}
}