Closing sockets with shell-command ?

Hello everyone.

(I have found in this forum lots of infos about closing socket in c, and others lenguages but never with shell-command)

Im developing a tool over tcl/tk; in this application i open a socket to communicate with a ada application.

In the init script i open both programs (tcl and ada) and each of them open a socket to communicate between them. When i close both programs, the sockets remains there during one minute more-less. I need some shell command to close it.

How can i close that sockest faster?? i really need to do it.
Is the problem in the "socket open options" perhaps?
The socket remains in "FIN_WAIT2 state" long time(1 minute). :frowning:

( Im using ubuntu 8.10 core 2.6.24-23-generic and bash version 3.2.39 )

Thx all.

There's nothing you can do in shell, I'm afraid, these are TCP sockets controlled by the kernel. There's most likely something wrong with the client end of the network connection. If the server is sitting in FIN_WAIT_2 it's because the client didn't send an ACK, or for some reason the ACK didn't get through. I suggest you research the issue from that angle instead, i.e. why is the client not sending an acknowledgement. Perhaps you're just missing a patch.

Thx

I wa thinking about it. Actually i simply close applications and i hope sockets to close properly. But now that im sure that its impossible to do with command, i will remake the close procedure to end connections in the right way.