How do I monitor the activity of sockets?

How to Monitor Sockets activity in a computer?

  • I want to write a program from scratch to see the sockets activity, what they send, what they receive, etc. I don't want to use a Library because it's more for academic purposes than anything else. Where should I start? Just to be clear: my program won't be connecting to anything or creating any socket, it just wants to listen to the activity in a computer. Any thoughts (in any OS) about where to start will be appreciated. Thanks in advance.

  • Answer:

Rafa-Nadal at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

You are out of luck as far as portability goes. ALthough the application APIs are the same or similar for UNIX and WIndows, and, both implentations are historicly based on the same Berkley Sockets BSD code, the operating system architecture and hence the ways you access low level OS fuctions such as network IO are completely different. Linux has a number of 'network sniffing' tools(tcpdump, ethereal etc.) easily available. Not so sure about windows, MS provides a Network Monitor and there are some tools available -- google 'Sysinternals TDImon' for the MS tools.

James Anderson

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.