我正在使用 RTI DDS Spy 来调试DDS应用程序。我注意到Spy工具中的奇怪消息,我认为这些消息不是来自我的应用程序。
问题是如何获取Src HostId
并找出发件人的IP地址? (Wireshark不是一种选择。)
答案 0 :(得分:1)
Src HostId
中的字段通常是源IP地址的十六进制版本。例如,请使用Spy的以下输出:
source_timestamp Info Src HostId topic type
----------------- ---- ---------- ------------------ ------------------
1369074721.938245 R +N C0A80103 CellTopic life::CellType
1369074721.937270 W +N C0A80103 CellTopic life::CellType
1369074721.938615 D +N C0A80103 CellTopic life::CellType
1369074721.938726 D +N C0A80103 CellTopic life::CellType
查看第三列C0 A8 01 03
中的四个字节,逐个将它们从十六进制转换为十进制,得到192.168.1.3
(因为C0
是十进制的192
, A8
为168
,显然01
为1
且03
为3
。)
顺便提一下,有关Src HostId
的详细信息,请使用rtiddsspy -hOutput
查看帮助:
Src HostId : Contains the sourceId part of the Global Unique
IDentifier (GUID) of the writer that sent the sample.
This value is formatted as an IP address because this
is the default setting for NDDS. Consequently this
column will match the IP address of the sender
of the message provided that: (1) the application is
running on an IP network, (2) it has not disabled the
UDPv4 transport and (3) it has not explicitly
overridden the 'appId'