Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working on a hack for internal purposes whereby I want to disconnect a program from it's socket without killing the process. For example, program A (running xxx.exe) is running on port 50000 and I want to stop that association and (so that I could theoretically use that port for something else). How would I do this in Windows 7 while keeping the EXE running?

NOTE: the program runs javaw.exe

share|improve this question
add comment

1 Answer 1

Well one easy way is to use TCPView or CurrPorts. They display a list of network connections and the programs that have them open. You can right-click them and select close to forcibly close the connection without killing the program.

Make sure to "run them as administrator" because this sort of action requires elevated privileges.

NB: while closing the connection does not inherently kill the program, there is always the possibility that it can crash. It is the same as closing a program's handle to a file/directory; the program remains running but may crash.

share|improve this answer
    
Good thought - I downloaded and tried this method with TCPView and it seemed to not allow this disconnection. Trying the other one now. –  nicorellius Jun 4 '12 at 18:19
    
Tried CurrPorts as well. Both apps don't seem to disconnect. They both have options to disconnect from the port, but when this option is selected, nothing seems to happen and the program, upon refresh, is still running and attached to the same port. –  nicorellius Jun 4 '12 at 18:27
1  
You need to run them as administrator. –  Synetech Jun 4 '12 at 18:34
    
I did, in both cases, run them as administrator... –  nicorellius Jun 4 '12 at 18:43
    
Try turning UAC off, running them, then back on. Also, what exactly happens when you select close? Does the status of the connection change? Maybe the program is simply detecting the lost connection and reestablishing it. –  Synetech Jun 4 '12 at 18:44
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.