Is it reasonable to a open connection each time you send a command via serial port, TCP/IP and so on?

122 views Asked by At

I'm developing software which controls various hardware via serial ports, TCP/IP, USB, etc. The main program usually works for hours or even days without restart. Each action of the program processed as follows:

  1. Open connection (port, VISA instr., TCP/IP)
  2. Send message/receive answer
  3. Close connection

The question is whether it's reasonable/safe/reliable to open and close connections each time? Or possibly it is better to open each connection just once per session at start?

0

There are 0 answers