UDP socket loopback problem while IP != 127.0.0.1

Apr 22, 2006 0 Replies

===================== RTOS - INTEGRITY Target - PowerPC 8260 Target IP Address - 10.1.1.1 Host: Microsoft IP Professional Host IP Address - 10.1.1.75 =====================


----------------- UDP Sockets



-----------------



socket1: ip1, port1 // on Target socket2: ip2, port2 // on Target socket3: ip3, port3 // on Host


ip1 == ip2 port1 != port2



ip1 != ip3 // ip3 == 10.1.1.75


---------------------------------- From Target to Target sendto () // From socket1 to (ip2, port2) - Target recvfrom() // On socket2 - Target



---------------------------------



Situation 1. ip1 == ip2 == 127.0.0.1 (The standard IP address used for a loopback network connection) It works fine. A message has been sent by using sendto() via socket1, and it has been received by using recvfrom() via socket2.


Situation 2. ip1 == ip2 == 10.1.1.1 (Target IP Address) It doesn't work. A message has been sent by using sendto() via socket1, but recvfrom() is waiting for a message (blocked) via socket2.



--- What could be reason for that?



--- Problem with a DNS server?


Additional information.



  1. gethostbyname() doesn't work on the target, i.e., doesn't produce its IP Address 10.1.1.1


  1. Similar UDP socket loopback program works fine on PC:
    formatting link
    formatting link

  2. Target -> Host ---------------------------------- From Target to Host ip1 = 10.1.1.1; ip3 = 10.1.1.75 sendto () // From socket1 to (ip3, port3) - Target recvfrom() // On socket3 - Host --------------------------------- It works fine. A message has been sent by using sendto() via socket1, and it has been received by using recvfrom() via socket3.


  1. The question was asked on news:comp.unix.programmer in thread
    formatting link
    about a month ago too.


Alex Vinokur email: alex DOT vinokur AT gmail DOT com http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required