I am using TCP sockets to communicate data between a server and client program using a specific port number on the same computer (localhost).
I need a software that can capture the data being sent/received through that socket?
(or)
What's the simplest way of sniffing packets from a specified port in Java?
You can use
tcpdump
that gives you a variety of options. You save the capture in a.pcap
file with the -w option and when you are done you open that file withwireshark
. The advantage of this way is that you can capture a high rate of packets per second without affecting the overall performance of your pc (even if it is low end).