2 years ago
#63503

SIDDHANI VAMSI SAI KUMAR
Maintaining LAN Redundancy in c++
I'm using Dell precision 3930 Rack workstation. It has two 10G LAN sockets to receive/send UDP data from other sub-systems.
Our C++ application spawns 2 threads. One thread receives/sends data from LAN1 and the other thread uses LAN2 for receive/send data. Both the threads are running independent.
Requirement:
By default Thread1 should receive data from LAN1 and Thread2 should not be doing any work.
Thread2 uses LAN2 to start receiving data when LAN1 is not present (LAN1 cable removed or some other hardware failure)
Thread2 will continue receiving data. LAN1 cable is connected and LAN2 cable is removed.
Now Thread2 goes to sleep and thread1 starts receiving data.
LAN2 cable connected. Thread2 sleeps still.
Summary:
LAN1 - connected, LAN2 - connected --------------- Thread1 receives and process data, Thread2 sleeps.
LAN1 - already connected, LAN2 - removed --------------- Thread1 continues to receive and process data, Thread2 sleeps.
LAN1 - removed, LAN2 - connected --------------- Thread2 receives and process data, Thread1 sleeps.
LAN1 - connected, LAN2 - already connected --------------- Thread2 continues to receive and process data, Thread1 sleeps.
LAN1 - removed, LAN2 - removed --------------- Thread1 and Thread2 goes to sleep.
Please someone suggest to me how to achieve this in c++?
c++
udp
0 Answers
Your Answer