0

You can connect to a COM device using the SerialPort class in C#. Can multiple programs connect to one COM device at the same time? Two or more programs connect to SerialPort.Open() I wonder if there is a way to connect at the same time without SerialPort.Close().

ceastgun
  • 81
  • 8

1 Answers1

1

As mentioned in the comments - write a proxy service program to connect to the COM device, other programs would be able to get the data from the proxy, a simple flow would be a Socket server that accepts 1 or more Socket client connections.

The server would be responsible for Serial communication with the COM device and sending the data back to the clients, since there's a hefty amount of code involved, and plenty of examples online on how to create an Async Socket server and Async Socket clients, here are some excellent examples without putting it all down here in the answer:

Asynchronous Server Socket Example

Asynchronous Client Socket Example

Socket Programming multiple client one server

kshkarin
  • 574
  • 4
  • 9