Actually, there's 2 ways that a port might be in use. One is as a listener port, the other is as a reply port. Listener ports are things like 80, 8080, 25, 443, 5432 and so forth. Reply ports are dynamically assigned on a short-term as needed to faciliate a 2-way conversation. For example, to receive the response on an HTTP request or to maintain the client-inbound link on a client/server session.
For the most part, reply ports can be ignored. They're assigned from an unlikely set of numbers. To check for a listener port, use the "-l" option of netstat.
This should tell you if port 80 is in use, for example:
Feel free to use egrep if you don't want to cascade plain greps. And be sure to include the trailing space in the expression, or you get false hits on things like port 8080!
An IDE is no substitute for an Intelligent Developer.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com