Google Answers Logo
View Question
 
Q: How to find your program's port numbers ( Answered,   0 Comments )
Question  
Subject: How to find your program's port numbers
Category: Computers > Operating Systems
Asked by: nginterface-ga
List Price: $5.00
Posted: 14 Jun 2003 18:01 PDT
Expires: 14 Jul 2003 18:01 PDT
Question ID: 217423
I'm trying to set up web services and test it on my computer, and in
the process, am _trying_ to use tcpmon (TCP Monitor) -- I'm trying to
"capture" what goes from the requestor to the service provider (trying
to capture all the SOAP messages over HTTP). Problem is, the tcpmon
requires me to specify a port to listen to (I already know the
_target_ port, which is 8080 on localhost), but I DON'T know how to
find out what the port is for my application that sends (requests) the
SOAP messages. Of course, the program that sends it is java.exe (I'm
on Windows 2000 pro). Is there any utility in Windows 2k that lets me
find what port binds to my program (dynamic port??)5

Request for Question Clarification by sublime1-ga on 14 Jun 2003 18:47 PDT
nginterface...

Go to 'Start' --> 'Run' and type:
cmd /K "netstat -a"

Let me know if this satisfies your needs.

sublime1-ga

Clarification of Question by nginterface-ga on 14 Jun 2003 19:27 PDT
Thanks, but I already know this command (netstat -a)...what I can't
figure out is, which one of those entries correspond with my
"requesting application" (which is java.exe)? I see the following:

TCP    NGINTERF-BINCUF:epmap  NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:microsoft-ds  NGINTERF-BINCUF:0      LISTENIN
TCP    NGINTERF-BINCUF:913    NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1027   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1031   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1046   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1047   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1068   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1076   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1099   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1182   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1188   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1206   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1207   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1209   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1521   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1629   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1630   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1631   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1632   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1638   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:1701   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2281   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2282   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2283   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2284   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2285   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2286   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2287   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:2309   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3047   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3048   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3049   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3050   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3051   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:3060   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:5001   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:5679   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8009   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8080   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8090   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8091   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8092   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:8093   NGINTERF-BINCUF:0      LISTENING
TCP    NGINTERF-BINCUF:netbios-ssn  NGINTERF-BINCUF:0      LISTENING

Also, the java.exe program runs only for a brief interval...when i
type:

java testClient http://localhost:8080/stdconn/StandardPersonData.jws
500800086

the java.exe connects with the web service located at

http://localhost:8080/stdconn/StandardPersonData.jws

by sending a SOAP message, to which the web service at

http://localhost:8080/stdconn/StandardPersonData.jws 

responds with another SOAP message...

Thanks!

Request for Question Clarification by sublime1-ga on 15 Jun 2003 00:29 PDT
nginterface...

According to the IANA port assignments list:
http://www.iana.org/assignments/port-numbers

...the following, of those listed on your machine, above,
are unassigned ports, and likely to be used by java.exe

1027
1046
1182
5001 (possibly)
8009
8080 you already know
8090, 8091, 8092 & 8093

Of these, the last 4 seem likely suspects, to me.

Hopefully that will narrow things down a bit for you.
Let me know where this takes you.

sublime1-ga
Answer  
Subject: Re: How to find your program's port numbers
Answered By: poormattie-ga on 15 Jun 2003 09:28 PDT
 
You may wish to take a look at the powerful (and free) Sysinternals
tools:
http://www.sysinternals.com

The application that will likely help you right away is their TCPView
utility:
http://www.sysinternals.com/ntw2k/source/tcpview.shtml

TCPView was designed to match TCP/UDP network activity to running
applications. It lists all of the running applications with network
activity, the local port they use, and the matching remote address and
port.

To use TCPView, you only need to download it into a local directory,
extract it from the containing zip file and double-click on it. If
your application is currently making its network connections, you
should see it in the list immediately.

Another free tool the Sysinternals group provides may also be useful
for you in analyzing the network traffic, especially if you have
multiple java VM's running (java.exe) and can't tell which is using
the port you are curious about. This utility is TDIMon, and it's found
here:
http://www.sysinternals.com/ntw2k/freeware/tdimon.shtml

TDIMon logs network traffic as it happens rather than analyzing the
connections already being held. Because of this, you can start TDIMon
and then quickly cause your java program to make it's connections.
Each network event from applications will be logged in the order
received, along with the local and remote ports.

A variety of software-based firewall applications may also help you
resolve this. For instance, I've used (in the past) the Sygate
Personal Firewall to help deduce which outgoing port is being used by
a particular application. The different editions of their firewall
software have different levels of logging traffic (to the point of IP
packet capture) that would help you tie network activity to a
particular application. You can download their free personal firewall
software here:
http://smb.sygate.com/products/spf_standard.htm

I was familiar enough with this topic that I didn't have to do much
searching, but I was able to use the following search terms to uncover
additional tools in this category that may help you:
"windows 2000" network monitoring tool

If this isn't the answer you're looking for, I encourage you to give
me an opportunity to clarify my answer. If this is the answer you're
looking for, happy hunting!
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy