Sign in to follow this  
code_evo

System::Net::Sockets, how to monitor ports?

Recommended Posts

code_evo    146
I'm looking into writing a simple firewall application in .NET I dont know much about sockets etc. I've only used the simple .NET TcpClient classes etc. How would I go about querying ports to find out if they are listening|open|connected etc. And the associative information. Any helpful link or resource would be appreciated. Thanks, /Jeff

Share this post


Link to post
Share on other sites
Arild Fines    968
You can't really write an application like a firewall using sockets, nor is it a very good idea to write it in C# or any other managed language. Writing a socket requires a pretty low level of access to the network stack, and, AFAIK, you need to write a kernel-mode driver. This is *not* something for beginners.

Share this post


Link to post
Share on other sites
code_evo    146
Well even though I'm a beginner at network programming, I'm not affraid of the challenge.

I've been researching, IPHelper, nDIS, and a few custom libraries.

Anyone tips on where to start?
I need to be able to monitor ports (which can be done through IPHelper) and block traffic (which I think NDIS will allow, but documentation is difficult for beginners)

btw, I dont need to use .net, mfc will be fine, or even console based but i'd like to write a gui so mfc probably.

Thanks,
/jeff

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this