I have a web application that fires relays to a turnstile when guest fill out visit details. Currently the code is written to make a web request which creates a socket, fires the relay, then closes the socket. Peak hours are only during the morning and afternoon where close to 500 visits can occur.
We have noticed the application getting hung up once in a while. I chose to open and close sockets since most of the time they would be idle, but what would you recommend is the best practice for connecting to the relay board? Should I open a single socket and keep it open as long as possible? Could opening and closing sockets cause problems with that many visits? Not sure that amount of request would cause issues. Please advise.