SerialPort class bug? RRS feed

  • Question

  • hi,

    Anyone encountered this behaviour using the serial port class? 
    Altering ReceivedBytesThreshold causes them application to intermittantly hang. In the IDE when i pause execution at a hang, the line:

    RS232Port.ReceivedBytesThreshold = &H1

    is highlighted with the text "This code has called into another function. When that function is finished, this is the next statement that will be executed". I'm wondering if this is the result of some sort of thread safety issue in my app, but it seems odd all the same.

    If anyone can shed some light on whats happening here, i'd be very grateful.


    Thursday, August 25, 2005 8:29 PM


  • Setting ReceivedBytesThreshold can actually call your SerialPort.DataReceived event handler synchronously. So if your DataReceived event handler can block for reading data or anything else then ReceivedBytesThreshold can block.

    Ryan Byington [MS]

    Tuesday, August 30, 2005 11:39 PM