1

I m able to retrieved active TCP and UDP connection using iphlpapi. The TCP Connection showing with source info(ip/port), Destination info(ip/port), state and process id. But for UDP Connection its no giving remote IP and port. That what i want to get. Any way to get destination information using source information or process id in Delphi or c++.

Leo Live
  • 23
  • 4

1 Answers1

2

UDP is a connectionless protocol. You can only get the local port that has been opened.

UPDATE: This applies for a static look at the port usage. However, if you have active UDP trafic you can still retrieve the remote endpoint.

User Ishmeet suggested uIP or LwIP in the comments.

UDP - Wikipedia

Connectionless Protocol - Wikipedia

cwin
  • 956
  • 1
  • 7
  • 14
  • 1
    No, you can get the IP address, I have done this on uIP, also on LwIP, on the callback function you receive the IP address and port number from the packet received – Ishmeet Jul 19 '13 at 12:29
  • OK, I agree... if you have active traffic you can get the senders endpoint. But the simple port usage information is not enough. – cwin Jul 19 '13 at 12:37
  • void udp_recv(struct udp_pcb * pcb, void (* recv)(void * arg, struct udp_pcb * upcb, struct pbuf * p, struct ip_addr * addr, u16_t port), void * recv_arg) -->http://lwip.wikia.com/wiki/Raw/UDP – Ishmeet Jul 19 '13 at 13:09