package javaflow.network.impl;
import javaflow.components.api.Component;
import javaflow.components.api.InputPort;
import javaflow.components.api.OutputPort;
import javaflow.components.api.Packet;
public class TestDropAndSendComponent implements Component {
InputPort in;
OutputPort out;
@Override
public void execute() {
try {
Packet packet = in.receive();
packet.drop();
out.createPacket("testing").send();
out.send(packet);
// Expect exception to be thrown from sending dropped packet
out.createPacket("failed").send();
} catch (Throwable e) {
}
}
}