sockets - How can I detect what program is listening to a tcp/ip port in Windows? -


i have application inherited listens on port 7001 udp broadcasts our in-house test equipment, , updated application needs same thing. both applications must able coexist on same computer.

currently, when updated application attempts bind port listen udp broadcasts , fails reports port not available , suggests inherited app running. how can application detect application listening on port? i've done google search , have searched site far have been unable find except use task manager, tcpview, or netstat @ command line.

i prefer technique either uses windows api or windows system com component, since both applications written in vb6. (i know, know, must maintain these applications since mission critical.) however, .net solution would useful in case need in new development efforts.

netstat -n -o 

that show process id , there can either in task manager's process viewer, goto view -> columns... , check process id (pid). can see name of process listening on port.

of course, you're wanting programmatic way of accomplishing , gettcptable2 api best suggested. in fact, if @ iat (import address table) netstat.exe, uses api information.

there way communicate directly command window , output using pipes , work fine ideal way use same api netstat uses.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -