Click to See Complete Forum and Search --> : Close Port


~Paul~
June 22nd, 2007, 12:11 AM
How would i go about closing lets say port 3000 on my computer with MSVC++ 6.0 ? Any idea? And i also did a search but didn't find anything worth while :(

TheCPUWizard
June 22nd, 2007, 12:31 AM
Depends what you mean by "closing". What EXACTLY are you trying to accomplish????

~Paul~
June 22nd, 2007, 12:40 AM
By close i mean to close the port so if someone trys to connect via that port they won't be able to.

TheCPUWizard
June 22nd, 2007, 12:44 AM
Well, they will only be able to connect to that port is something is listening. So stop the listener :D

Or use Windows Firewall to block the Port.....

Or use a Third Party software firewalll.....

Or use a Hardware Firewall....

~Paul~
June 22nd, 2007, 12:48 AM
Yea those work :) But i need to do using C++ code.

TheCPUWizard
June 22nd, 2007, 01:09 AM
Then you need to write a firewall yourself. Based on my (extensive) expeerience, you can count on these estimates:

1) If you write from scratch, and have no experience in this area - 6 man-months (1000 hours)

2) If you are experienced in Windows Kernel Development and TCP/IP protocols, and still write from scratch - 2 man months (480 hours)

3) If you are willing to tailor an "OpenSource" solution to your needs - 1 man month (320 hours)

[ps: The math for 1 month is 8 hours * 5 days * 4 weeks, the formula for a man year accounts for 2 weeks vacation, and is based on 50 work weeks..., so the numbers above are actually consistent ;) ]

btw: Last year I developed a very special FireWall for a client (remember I have been doing this for over 30 years). The final net price was over $50K....

dog_pig_baby
July 2nd, 2007, 10:01 AM
It is just a temp method,but may help you


Call setsockopt function and set SO_EXCLUSIVEADDRUSE flag