how to kill a tcp connection in solaris operating system?

0

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?

Alireza

Posted 2014-01-14T17:03:11.877

Reputation: 1

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 – 2014-01-14T17:08:04.810

@FrankThomas Essensial NetTools in windows can do this job – Alireza – 2014-01-14T17:10:42.380

No answers