I have been programming in C++ since 1989. However, they were in-house programs for GTE. Now, I have a very large project (retired now) that I want to change from Serial to TCP/UDP polling. Far end are RS422 devices that communicate on 4 wires and can be converted to USB virtual ports. Now that I have done that, there is a need to scrap all this and go with IP. There are several converters out there that converts such devices as mine to IP.
Question: what is the best way to poll these devices, TCP or UDP. Mind you, each converter can handle up to 64 devices and my program can handle 4 of these devices (or 4 BUS if serial).
I use 4 threads to poll the serial bus and was thinking the same for IP. I think Threads are more efficient than waiting for a message to be acted upon because its dependent on the OS if its busy or not; threads dont care. The RS422 devices will send a Hex signal asking for a door to be opened and then the computer will send either ok or not. Every minute, the computer will scan the devices to make sure they are still online. So, any of the sides will need to start a communication and the computer must be ready for a reply quickly (<50 msec) to open a door. What does anybody thinks and why? UDP or TCP? or something else?
Thanks in advance
What I have tried:
buying 8 books on the suject by Authors Douglas Schmidt, Stephen D. Huston "ACE Programming", W. Richard Stevens, Douglas E. Comer, and Michael J. Donahoo. Hopefully studying these books and your answers may give me a head start.