I have a C# application that communicates with a 4G USB modem over USB via AT commands. My problem is that if the device gets physically disconnected while the serial port is open, I cannot close the connection. If I try to close the connection, I get an exception:
An unhandled exception of type 'System.IO.IOException' occurred in System.dll
Additional information: A megadott port nem létezik. (The port doesn't exist)
I've seen a similar question here on stackoverflow, but people didn't seem to understand the problem.