|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SerialPort on a ThreadI have a problem with SerialPort that can't seem to find a solution for a couple of days now. I use the SerialPort to send AT commands to a modem. Simple AT commands like ATE1, ATQ0 etc. and simple call. Open the port, Send the AT command, read the response, close the port. When I use SerialPort in an OnClick event of a button in a form everything works fine. When I use SerialPort from inside a thread in single processor system everything still works fine. When I use SerialPort from a thread in a 4 cpu server, sending to the port seems to work fine, but no data ever come from it. The BytesInRead property is always zero, and the DataReceived event never fires. The same thing on the same server, works fine if called from a OnClick event of a button in a form. That is when called from the application's main thread. Does anyone has any ideas? Thank you all in advance George Hi,
I think you need to report this as a possible bug on: http://msdn.microsoft.com/vstudio/support/. I do not have a multiple processor system, so I cannot confirm it. Sorry. Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information. Dick Grier wrote:
> Hi, Thanks for your time Dick,> > I think you need to report this as a possible bug on: > http://msdn.microsoft.com/vstudio/support/. > > I do not have a multiple processor system, so I cannot confirm it. Sorry. > > Dick > It was actually a thread serialization problem since in 4 cpu systems things really go parallel. George OK, thanks for reporting back.
-- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information. |
|||||||||||||||||||||||