How to get the destination address of an incoming udp dgram?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to get the destination address of an incoming udp dgram?

ソリューションへジャンプ
1,104件の閲覧回数
m_bach
Contributor III

Hi Community,

I'm looking for a way to tell an incoming IPv4 UDP unicast from incoming IPv4 UDP broadcast.

I found this howto, but I canot find 'struct mh' and function recvmsg() MQX v4.1.1:

linux - Get destination address of a received UDP packet - Stack Overflow

Is there an MQX way of getting the destination address?

Please note: recvfrom() gives me the sender's address to be able to reply the datagram, what I need is the destination address.

Thanks a lot, Martin

ラベル(1)
0 件の賞賛
返信
1 解決策
937件の閲覧回数
m_bach
Contributor III

I helped myself with creating three sockets to the same UDP port:

one for IPv4 bound to the interface IP, one IPv4 bound to INET_ANY, one last but not leas one to IPv6.

that'll do.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
938件の閲覧回数
m_bach
Contributor III

I helped myself with creating three sockets to the same UDP port:

one for IPv4 bound to the interface IP, one IPv4 bound to INET_ANY, one last but not leas one to IPv6.

that'll do.

0 件の賞賛
返信