Solved

Winsock

Posted on 2003-10-23
5
317 Views
Last Modified: 2010-04-01
I need an application I am writing in C++ to be able to use WinSock (or other method) to block all TCP/IP sockets at the click of a button (and obviously resume the traffic). Does anyone how I would go about this in C++? Thanks.
0
Comment
Question by:dwgebler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 125 total points
ID: 9611067
1) This is not a C++ language question.  It's a Windows programming question.

2) WINSOCK is not able to do this.  You want to program such an application using the NDIS Intermediate driver interface.  See: http://www.rawether.net for information and a toolkit.  There is also an NDIS IM sample in the Windows 2000 and XP DDK.
0
 

Expert Comment

by:gdean
ID: 9622062
Id tend to agree with jhance on #1, however could you go into greater detail as to what you mean by block all traffic?  Maybe describe in a little more detail the design of your program.  Are you trying to stop communication internally to your app or throughout the entire system?

mulitthreaded/iterative/async/overlapping? server/client? etc...
0
 

Author Comment

by:dwgebler
ID: 9623037
I nned my app to be able to block all internet traffic, but I am not a networking programmer so I've no experience in this. I guess blocking the ports for TCP/IP communication is what I want to do (and of course enable it again as well). Is there any way to do this without a lot of complex networking knowledge? I use Norton Internet Security 2003 and it notably has the kind of thing I need for this project as one of its features. You can click a button to block all traffic and resume it any point.
0
 

Expert Comment

by:gdean
ID: 9623949
I agree with jhance
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question