[Webinar] Streamline your web hosting managementRegister Today


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
  • 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

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

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

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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

612 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