Closing sockets with shell-command ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Closing sockets with shell-command ?
# 1  
Old 06-01-2009
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). Smilie

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

Thx all.
# 2  
Old 06-01-2009
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.
# 3  
Old 06-01-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print a closing XML tag shell script

I have a shell script that does everything I need it to do. But, when I was testing it I realized it doesn't print the closing XML tag.... Does anyone know how to incorporate printing the XML tag with my script? I am using AWK any help would be appreciated. (4 Replies)
Discussion started by: risarose87
4 Replies

2. Shell Programming and Scripting

Help with Shell Script opening and closing a program

REALLY new to this stuff, sorry. So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen. Anyway... (6 Replies)
Discussion started by: plsbbg
6 Replies

3. UNIX for Dummies Questions & Answers

Prevent terminal from closing after command execution

Hello, I want to create application which launches some terminal, then some command is executed on that terminal and then prevent terminal from closing. I started to do on gnome-terminal because the Gnome is the most widely used desktop-manager in the Linux distributions. I want to do... (3 Replies)
Discussion started by: tyanata
3 Replies

4. Shell Programming and Scripting

Sed command to replace with pattern except for text and closing parentheses

Can someone help me with a sed command: There will be multiple occurences in a file that look like this: MyFunction(12c34r5) and I need to replace that with just the 12c34r5 for every occurrence. The text between the parentheses will be different on each occurrence, so I can't search for that.... (4 Replies)
Discussion started by: missb
4 Replies

5. IP Networking

Closing the socket

Hi, I have a question on closing the listen socket in server. In the application I am working, the server is continously receiving requests from the client in its master socket to handle each request. There is an option to shutdown the server process. In this case do I need to explicitly close... (1 Reply)
Discussion started by: naan
1 Replies

6. UNIX for Dummies Questions & Answers

xterm closing automatically after command excution

Hi, I have a commands in a file called commands.file, I am using this file with the following commnad xterm -e "commands.file" After executing this file in the new xterm, it is closing automatically. I want to use that xterm after that. Please help me regarding this? :) ... (4 Replies)
Discussion started by: chaitubek
4 Replies

7. Shell Programming and Scripting

closing windows

Ok i know to open a window from a script (mac); open whatever(name of a directory) but i don't how to close it. please some help. thanks. (0 Replies)
Discussion started by: Tártaro
0 Replies

8. IP Networking

sockets using SHELL program

Hello sir. I could establish the connection between any 2 systems in LAN using Socket Class in Java. I would like to learn more and know how to connect to other users in the LAN and send the messages using the shell instead of java.......... (2 Replies)
Discussion started by: nsharath
2 Replies

9. Shell Programming and Scripting

closing a telnet session on error, in a shell script

I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed. I want to be able to close the session and complete the script execution in... (1 Reply)
Discussion started by: farahzaiba
1 Replies

10. Post Here to Contact Site Administrators and Moderators

Closing a thread

hi, Just wondering if there could be a way to close threads whose creator has got the desired reply. however if someone still wants to give a remark or suggest further on the thread one can still do so. Besides on the control panel there should be some kind of selection criteria to view... (3 Replies)
Discussion started by: linuxpenguin
3 Replies
Login or Register to Ask a Question