0

I made a Delphi application that transmits data to COM port every second. The COM port is a virtual null-modem (com0com) between the data transmitting software and a VirtualBox machine. Everything is fine, but if nothing is listeninig at the other end Host Windows becomes increasingly unresponsive.

Paul
  • 25,812
  • 38
  • 124
  • 247
  • I think there is a possibility to flush the transmit buffer before sending new data. – LU RD May 08 '17 at 14:27
  • To purge the transmit buffer, call `PurgeComm(comHandle,PURGE_TXCLEAR);` You may also set the timeout to a reasonable value. – LU RD May 08 '17 at 18:45
  • 1
    I've had the same using com0com, but I've since moved to named pipes to simulate/debug serial communication. – Stijn Sanders May 09 '17 at 07:19
  • I also wonder if [SetCommTimeouts](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363437.aspx) could make in change in your case. – Stijn Sanders May 09 '17 at 07:20
  • @Stijn Sanders: I also tried named pipes, but they aren't suitable to transfer data from the host to guest (or I must update my software to use named pipes instead of COM port) and I must always start other virtual machine before even it I am not planing to use it, otherwise my first virtual machine refuses to start. – Paul May 09 '17 at 09:16

1 Answers1

0

After I went from com0com to pure hardware solution the problem disappeared. Also my application in virtual machine stopped to hang regularly.

Paul
  • 25,812
  • 38
  • 124
  • 247