if (payloadLength > 0) {
PacketFactory<Packet, TcpPort> factory
= PacketFactories.getFactory(Packet.class, TcpPort.class);
Class<? extends Packet> class4UnknownPort = factory.getTargetClass();
Class<? extends Packet> class4DstPort = factory.getTargetClass(header.getDstPort());
TcpPort serverPort;
if (class4DstPort.equals(class4UnknownPort)) {
serverPort = header.getSrcPort();
}
else {
serverPort = header.getDstPort();