Block or allow the UDP transactions

Posted on 2005-03-16
Medium Priority
Last Modified: 2008-02-01

I was try to create  a simple application that allow or block a single connection.For TCP Connections i use this api:

SetTcpEntry Lib "iphlpapi.dll" (pTcpTableEx As Type_Table_TCP) As Long

and work fine.But this not work with the UDP transactions.What can i do to block the UDP tranactions ?

Question by:Marco_Panza
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
  • 3
LVL 39

Accepted Solution

itsmeandnobodyelse earned 2000 total points
ID: 13563242
The article


says that the only state to which a TCP connection can be set is MIB_TCP_STATE_DELETE_TCB. I assume, you are doing that in order to "block" the connection. SetTCPEntry will set the state of the connection entry to MIB_TCP_STATE_DELETE_TCB, what most likely prevents the connection from working.

An UDP entry has in the UDP ENTRY Table (you may get it by GetUdpTable) doesn't have a state as UDP is a connectionless protocol. The entry only contains IP address and port of one node. As there is no connection you can't block connections.

Regards, Alex

LVL 39

Expert Comment

ID: 13563291
By googling I found that <strstream> was an older version of <sstream> that should be replaced by the latter when ever possible. If you could do an update of your compiler you should get new <sstream> header file.

I couldn't say whether an #include <strstream> would compile but it may be worth a trial.

Regards, Alex
LVL 39

Expert Comment

ID: 13563297
Sorry, the last answer belongs to another thread.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

801 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