hi how can i know on which port my application is running
thanks in advance
hi how can i know on which port my application is running
thanks in advance
What port did you tell it to run on?
(You're going to have to give us more details about exactly what you/your program are/is doing for us to be able to give you a more helpful answer than the above.)
That's not a lot of information to go on, but if your app is a general purpose TCP server and you're really not sure whether it's running or not, or on what port, try:
netstat -an -p tcp
(This is a UNIX/Linux/OS X command... not sure what the Windows equivalent is but it will be similar)
This will show you all listening sockets on your machine and the IP address/port on which they are listening. One of them may be your app.
There is a nice util at SysInternals called TCPView.exe
http://live.sysinternals.com/Tcpview.exe
That shows all connections and process IDs
Inside a Servlet you can ask the HttpRequest object how it was invoked including the port and hostname. There is no standard API for a servlet interrogating the container.
If your app is a server, and you need to test if it's listening, you can use
netstat -ltpn
The meaning of the switches:
Run it as root (e.g. with sudo) to get process info on sockets opened by the root's processes.
This is for UNIX/Linux. Please specify the system you're using to get more precise answers.