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.

A client program connects to my server program written in JAVA via TCP connection (ServerSocket). I want to close the TCP connection between these two programs with a Solaris command or tool for debugging purposes, Something like Essensial NetTools in windows which can close a TCP connection. What should I do?

The ProcessID ($PID) of server application can be found with following command:

jps -ml 

$PID server.jar

The TCP connection can be seen by following command:

pfiles $PID

  33: S_IFSOCK mode:0666 dev:309,0 ino:22564 uid:0 gid:0 size:0
      O_RDWR
        SOCK_STREAM
        SO_REUSEADDR,SO_SNDBUF(16384),SO_RCVBUF(17520)
        sockname: AF_INET 10.20.11.41  port: 3066 <--server
        peername: AF_INET 172.18.21.11  port: 38532 <--client

Now, How to close this connection?

Can send SIGKILL to the Socket connection? if so, How?

share|improve this question
    
now that I think about it, I don't know if you can kill a connection discretely on any platform I've worked with. you can kill the process, or interrupt the connection itself with the firewall, but the process controls the ports and connections using a sockets API usually, and as such there is no middleman who would be in a position to disconnect a given conversation. –  Frank Thomas Jan 14 at 17:08
    
@FrankThomas Essensial NetTools in windows can do this job –  Alireza Jan 14 at 17:10

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.