New answers tagged

1

I improved my code and now I made console application for tracking IP packets. I tracked IP packets with Wireshark and got same result. IPPacket class now contains IPHeader and ProtocolHeader data. UDPHeader and TCPHeader class inherit abstract ProtocolHeader class, I added method ParseProtocolData which return UDPHeader or TCPHeader depending on protocol ...


2

I would rename IPPacket to PacketParser, and then create an IPacketParser interface that defines the parse method, but make it a regular method, not static. Then, I would create a TcpPacketParser class and a UdpPacketParser class, which would eliminate the need for your switch logic within the parse method, thus there would be no need to return the ...


Top 50 recent answers are included