none
C# SerialPort Sending data from thread is delayed RRS feed

  • Question

  • Hi,

    I have an application having 3 serialports. I have implemented the solution using Io.Ports.SerialPort class. The problem is I have to send data to the serial device in a thread. While i do the the send is delayed a lot, but the same doesn't happen when i send it on an event say I click a button and send the data.

    Any help would be highly appreciated. 

    thanks

    giridhar

    Saturday, January 11, 2020 5:50 AM

All replies

  • We can't possibly help without seeing more of your code.  It should be clear that the serial port driver doesn't give a ding dong what thread the request came from.  So, the problem must be in your code.  Are you synchronizing your threads in some way?

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Sunday, January 12, 2020 6:37 AM