Should I support SerialPort connection?

I work with serial communications and I wonder if SerialPort should be opened or not?

I create a queue of commands, and only one will work at a time. Should I create a SerialPort and open / close it in each command, or do I need another class that supports opening a port and is called from commands? Or does it really matter?

+3
source share
2 answers

Keep it open. It makes no sense to have overhead when opening and closing.

+5
source

C. Ross, , - , SerialPort . .

+3

Source: https://habr.com/ru/post/1725653/


All Articles