Sponsored Content
Top Forums Programming C Prog to close a socket in established state Post 7911 by teledelux on Wednesday 3rd of October 2001 11:14:24 AM
Old 10-03-2001
C Prog to close a socket in established state

I have a SUN environment running an WebLogic that communicates w/a 3rd party running IIS. When the IIS site goes down (frequently), I am stuck with sockets in an ESTABLISHED state, and cannot seem to figure out how to avoid this. No exceptions are thrown as I can still open connections to the IIS site, but no data is returned.
What I would like to do is to determine from lsof -i tcp@host, the file descriptors, and then determine how long they have been in ESTABLISHED state, and then close them if they are older than say 1 hour.....

Any ideas????

As always- all help and assistance is greatly appreciated.
 

9 More Discussions You Might Find Interesting

1. HP-UX

socket close hangs and CPU go to 100%

Hello, I'm currently having a problem with HPUX. The application is a C app. It's a socket server. It runs mostly fine, but under some circumstances (I can not replicate it), the app hangs and the CPU goes to 100%. I have use gdb to attach to the app, and it was doing a close(). the... (0 Replies)
Discussion started by: arico
0 Replies

2. HP-UX

Close Socket at HP-UX

Hi all, I have a HP-UX 11.23 that have a Server establishing connections on port 8888 . The problem is that when i need to stop and restart the Server, the connections mantain the same state and i need to wait about 20-30 minutes before all connections finishes. The connections remain at... (2 Replies)
Discussion started by: Renato Gregio
2 Replies

3. UNIX and Linux Applications

any way to close socket

I have written a socker program. I have executed that program many times without closing the socket. So I want to find which all sockets binded with which file descriptor. Is there any way to close those socket, which have been opened in that program's execution. please help me!.. (3 Replies)
Discussion started by: pa.chidhambaram
3 Replies

4. Programming

socket close() -w- pthreads linux 2.6.18.2-34 (suse) SMP

Interesting issue. There was some discussion on the LKML last year regarding the potential problems in concurrent applications reusing file descriptors in various scenarios. The main issue is that the reuse of a file descriptor and reception of data in a threaded application can be confused pretty... (1 Reply)
Discussion started by: ramen_noodle
1 Replies

5. IP Networking

Is it necessary to close socket after a unstop loop?

Is the last two line necessary? #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main(void) { struct sockaddr_in stSockAddr; ... (0 Replies)
Discussion started by: vistastar
0 Replies

6. Solaris

socket in listen state disappears/closes automatically

Hi, I am using solaris 10. I have opened a socket connection using java in solaris 10 operating system, the port went to LISTEN state and able to create new socket connection and the new connections went to ESTABLISHED state. If I issue the command "netstat -an | grep <<portnumber>>", I... (10 Replies)
Discussion started by: kumar3k
10 Replies

7. Debian

Help socket prog

HI Can anyone provide me with codes for file transfer server to client or vice versa? Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming. Thanks (0 Replies)
Discussion started by: mayhemtrigger
0 Replies

8. AIX

How to repair a TCP/IP socket in state: CLOSE_WAIT?

Hi The clients connect to my server -using port 9130. But no client could connect to my server at this time. I've checked already and this is the result netstat -Aan|grep -v 127.0.0.1|grep 9130|pg f10006000abcb398 tcp4 10313 0 10.0.89.81.9130 10.158.70.24.1705 CLOSE_WAIT... (8 Replies)
Discussion started by: bobochacha29
8 Replies

9. UNIX for Advanced & Expert Users

30 tcp connections Established for a while and after a few minutes are close

Good morning, I need your help please After Restarting Aps or connection, these are connections tcp 0 0 10.80.1.26.57597 10.81.248.79.53008 ESTABLISHED tcp 0 47 10.80.1.26.57607 10.81.248.79.53008 ESTABLISHED tcp 0 0 ... (4 Replies)
Discussion started by: alexcol
4 Replies
LWP-RGET(1)						User Contributed Perl Documentation					       LWP-RGET(1)

NAME
lwp-rget - Retrieve web documents recursively SYNOPSIS
lwp-rget [--verbose] [--auth=USER:PASS] [--depth=N] [--hier] [--iis] [--keepext=mime/type[,mime/type]] [--limit=N] [--nospace] [--prefix=URL] [--referer=URL] [--sleep=N] [--tolower] <URL> lwp-rget --version DESCRIPTION
This program will retrieve a document and store it in a local file. It will follow any links found in the document and store these documents as well, patching links so that they refer to these local copies. This process continues until there are no more unvisited links or the process is stopped by the one or more of the limits which can be controlled by the command line arguments. This program is useful if you want to make a local copy of a collection of documents or want to do web reading off-line. All documents are stored as plain files in the current directory. The file names chosen are derived from the last component of URL paths. The options are: --auth=USER:PASn Set the authentication credentials to user "USER" and password "PASS" if any restricted parts of the web site are hit. If there are restricted parts of the web site and authentication credentials are not available, those pages will not be downloaded. --depth=n Limit the recursive level. Embedded images are always loaded, even if they fall outside the --depth. This means that one can use --depth=0 in order to fetch a single document together with all inline graphics. The default depth is 5. --hier Download files into a hierarchy that mimics the web site structure. The default is to put all files in the current directory. --referer=URI Set the value of the Referer header for the initial request. The special value "NONE" can be used to suppress the Referer header in any of subsequent requests. The Referer header will always be suppressed in all normal "http" requests if the referring page was transmitted over "https" as recommended in RFC 2616. --iis Sends an "Accept: */*" on all URL requests as a workaround for a bug in IIS 2.0. If no Accept MIME header is present, IIS 2.0 returns with a "406 No acceptable objects were found" error. Also converts any back slashes (\) in URLs to forward slashes (/). --keepext=mime/type[,mime/type] Keeps the current extension for the list MIME types. Useful when downloading text/plain documents that shouldn't all be translated to *.txt files. --limit=n Limit the number of documents to get. The default limit is 50. --nospace Changes spaces in all URLs to underscore characters (_). Useful when downloading files from sites serving URLs with spaces in them. Does not remove spaces from fragments, e.g., "file.html#somewhere in here". --prefix=url_prefix Limit the links to follow. Only URLs that start the prefix string are followed. The default prefix is set as the "directory" of the initial URL to follow. For instance if we start lwp-rget with the URL "http://www.sn.no/foo/bar.html", then prefix will be set to "http://www.sn.no/foo/". Use "--prefix=''" if you don't want the fetching to be limited by any prefix. --sleep=n Sleep n seconds before retrieving each document. This options allows you to go slowly, not loading the server you visiting too much. --tolower Translates all links to lowercase. Useful when downloading files from IIS since it does not serve files in a case sensitive manner. --verbose Make more noise while running. --quiet Don't make any noise. --version Print program version number and quit. --help Print the usage message and quit. Before the program exits the name of the file, where the initial URL is stored, is printed on stdout. All used filenames are also printed on stderr as they are loaded. This printing can be suppressed with the --quiet option. SEE ALSO
lwp-request, LWP AUTHOR
Gisle Aas <aas@sn.no> perl v5.12.1 2009-06-15 LWP-RGET(1)
All times are GMT -4. The time now is 04:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy