I am working with the MSComm Control in VB.NET, and I also run a TcpListener object in a separate thread to listen for incoming requests in an infinite while loop and call MSComm commands when it has received requests to connect to the comm port, send certain commands through the comm port, and so on.

My problem is that when the event MSComm_onComm is raised continuously due to the fact that there is a constant stream of data coming in from the comm port, the whole program freezes.

This problem doesn't occur if I don't have the TcpListener object running, ie. MSComm_onComm runs without any problem at all.

Would appreciate it anyone could explain what is wrong, as I am a newbie at this, Thanks!