I am using the Comm API, i have made a small desktop app for sending sms. I cannot send sms one after the other since it gives "Port In Use Exception".

I have closed the Input and output streams as well as the serial port but still it gives "Port in Use Exception".

Can anybody help me with this please?

Recommended Answers

All 2 Replies

Why not keep the port and its in/out streams open? Sounds like you are trying to re-open something, which may not be necessary?

I used the reference of the serial port in some other class which was still using the serial port, to close the connection there. I was doing it in the same class therefore it was showing nullpointexception. Anyways, thanks for the reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.