c# - How to receive multiple tasks at the same time in a single com port in c sharp -
I'm a novice fast and IM stuck with this task I need to, I am creating many threads and ask to communicate with this thread (using COM1) to a serial port, COM2 will send all threads using a single COM port (received using COM2).
Say "Send 1 Thread 1" (using Thread 1) and "NarcorWald 2" (Thread 2) by using Com 1 and Hyper-Terminal in Compi2. So I need to look at both the hellfire at Harper-terminal at the same time.
Please help me
You would like to start. You can instantiate SerialPort class 2 instances for each comm port you want to send / receive. I have used 2 variations to obtain a serial port class:
1 You can "read" on the port manually on a certain interval (like you can read each thread as needed).
2. The SerialPort class exposes a DataReceived event that can be subscribed (an error is also available).
Option 1 may be the best fit.
Edit
After reading your comment, option 2 can be a better fit so that you can get a "thread" thread that subscribes to data receiver / error recycled events The slash @ @ sliders will need to be sure to write only 1 thread at any time.
Comments
Post a Comment