I make a c# application to catch TCP/IP packets by Socket.I bind the local ip and listen all the ports to catch the IP packets .Sometimes,it was effective and caught all IP packets.But some IP packets which I could catch with SharpPcap(winPcap) apis was lost.So I confuse.Who know something about it?
Asked
Active
Viewed 304 times
0
-
This is very vague, I barely understand what you mean. TCP is not a lossy protocol so you don't lose packets unless your internet connection is dropped, and the built-in classes for using sockets/TCP doesn't automatically function as something just catching all incoming packets. Please create a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Visual Vincent May 28 '16 at 08:29
-
winPcap will catch all type of IP while a TCP listener will only catch TCP IP. TCP is one of the many types of IP protocols. Every connection requires three properties 1) Source IP address 2) Destination IP address 3) Port Number. A listener is a connection on a local PC that uses the "all ports" IP address as the source IP address. – jdweng May 28 '16 at 10:05
-
Every IP device is required to contain an "all port". When an IP is received on the PC it is forwarded to the "all port". The all port process then check all applications to find if any apps are registered for the port and send message to the process. Messages can be loss if more than on app is register for the port or if the port is block by a firewall or virus protection program – jdweng May 28 '16 at 10:05