获取目标ip/活动udp连接的端口? [英] Get Destination Ip/Port of active udp Connection?

查看:258
本文介绍了获取目标ip/活动udp连接的端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够使用iphlpapi检索活动的TCP和UDP连接. TCP连接显示源信息(ip/端口),目标信息(ip/端口),状态和进程ID. 但是对于UDP连接,它没有提供远程IP和端口.那就是我想要得到的. 在Delphi或c ++中使用源信息或进程ID获取目标信息的任何方法.

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++.

推荐答案

UDP是无连接协议.您只能获取已打开的本地端口.

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

更新: 这适用于静态查看端口使用情况.但是,如果您有活动的UDP流量,您仍然可以检索远程端点.

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.

用户Ishmeet在评论中建议使用uIP或LwIP.

User Ishmeet suggested uIP or LwIP in the comments.

UDP-Wikipedia

无连接协议-维基百科

这篇关于获取目标ip/活动udp连接的端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆