2

I have made an App for watching Active tcp/udp connections for the local pc. Now, my list of connections is static, How do i make it dynamic? I tried to use Timer events,but GetExtendedTCPTable returns the full list of connections. I only desire that the new connections be added to my listView. Is there some API to do the same? or do i have to manually keep track of all the connections,compare them, and then add to display?

Thanks in Advance

Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
CyprUS
  • 4,159
  • 9
  • 48
  • 93
  • I don't know the answer to your question, but I know: there is no such connection when dealing with UDP. UDP is a datagram protocol and therefore connection-less. – ckruse Jul 22 '11 at 06:32
  • Yes, thanks for the clarification. How to do it for TCP then – CyprUS Jul 22 '11 at 06:33
  • [Here is the list of Ip Helper Functions at MSDN](http://msdn.microsoft.com/en-us/library/aa366071(v=VS.85).aspx). As far as I can see there's no function to raise notifications when new connections are detected. Pooling such sensitive information using a timer sounds like a bad idea (lots of data, networking might slow down because of the pooling). AFAIK firewall applications do this using a NDIS driver. – Cosmin Prund Jul 22 '11 at 07:18
  • @cosimn: Can you give some code/URL to get me started with NDIS driver? – CyprUS Jul 22 '11 at 07:22
  • @CyprUS you can't code a driver in delphi – opc0de Jul 22 '11 at 07:24
  • @CyprUS, no, and AFAIK you can't write drivers with Delphi any way. – Cosmin Prund Jul 22 '11 at 07:25
  • How to do this then ; the opCode way – CyprUS Jul 22 '11 at 07:34

1 Answers1

0

You can use a timer first you put all connections in a list then at the next timer cycle you use another list and compare them and see what changes occurred. I don't think an elegant method exists on this problem.

opc0de
  • 11,557
  • 14
  • 94
  • 187
  • The windows people must have a look at this problem. It could take a lot of headache out for me :) – CyprUS Jul 22 '11 at 06:53