I have developed a TCP/IP client (QNX) program which requests communicates with ethernet TCP/IP enabled microcontroller based devices.
The devices at startup are configured with fixed (pre-decided) IP adrresses. The devices are programmed in listening mode and hence wait for connection request from client (QNX program). Once the connection is successfully established, client sends data packets. On receipt of valid data packet, device (non-qnx) returns a response packet to client program.
I have tested this TCP/IP communication on ethernet connectivity and everything is working fine. If the device or LAN switch is powered OFF, QNX client program tries to establish a new connection.
I then tried to conduct experiments on this connectivity by exception testing. I need help with the following :-
1.] What would happen if 2 of the devices on the ethernet network are started with same IP address? Will my QNX program communicate with one of the two devices or will it not communicate at all?
2.]If only one device is configured on network with IP address 192.168.0.3. My program communicates with it. Then I powered it OFF and observed that my program tried to establish a new connection. On power ON of the device, my program started communicating with the device. Then I again switched it OFF and observed that my program tried to establish a new connection. I powered on another device with same IP address and observed that my program failed to communicate with it. On running netstat -an, I noted that state of socket was FIN_WAIT_1 on QNX computer. On restart of the program, my program did not communicate with the device. Then I decided to restart Socket. On restart of Socket process, my program started communicating with the device. What does this FIN_WAIT_1 indicate and how to resolve this problem?