===================== 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.
- gethostbyname() doesn't work on the target, i.e., doesn't produce its IP Address 10.1.1.1
- Similar UDP socket loopback program works fine on PC: formatting linkformatting link
- 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.
- The question was asked on news:comp.unix.programmer in thread formatting linkabout a month ago too.