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
IIS(3pm)						User Contributed Perl Documentation						  IIS(3pm)

NAME
PDL::Graphics::IIS - Display PDL images on IIS devices (saoimage/ximtool) SYNOPSIS
use PDL::Graphics::IIS; saoimage ( -geometry => '800x800' ); iis rvals(100,100); DESCRIPTION
This module provides an interface to any image display 'device' which support the 'IIS protocol' - viz the SAOimage and Ximtool X-windows programs, the old SunView imtool program and presumably even the original IIS CRT itself if they aren't all in museums! These programs should be familiar to astronomer's - they are used by the common IRAF system. The programs and their HTML documentation can be obtained from the following URLs: SAOimage: http://tdc-www.harvard.edu/software/saoimage.html Ximtool: http://iraf.noao.edu/iraf/web/projects/x11iraf/x11iraf.html Non-astronomer's may find they quite nifty for displaying 2D data. The Perl variable $stdimage is exported from the module and controls the frame buffer configuration currently in use. The default value is "imt1024" which specifies a "1024x1024" frame buffer. Other values supported by the module are: imt512, imt800, imt1024, imt1600, imt2048, and imt4096. If you have a $HOME/.imtoolrc you can use it to specify other frame buffer names and configurations in exactly the same way you can in IRAF. Here is a sample file: -------------------snip------------------------- # Format: configno nframes width height 1 2 512 512 # imt1|imt512 2 2 800 800 # imt2|imt800 3 2 1024 1024 # imt3|imt1024 4 1 1600 1600 # imt4|imt1600 5 1 2048 2048 # imt5|imt2048 6 1 4096 4096 # imt6|imt4096 7 1 8192 8192 # imt7|imt8192 8 1 1024 4096 # imt8|imt1x4 9 2 1144 880 # imt9|imtfs full screen (1152x900 minus frame) 10 2 1144 764 # imt10|imtfs35 full screen at 35mm film aspect ratio -------------------snip------------------------- (Note: some versions of SAOimage may not even work if this file is not present. If you get funny error messages about 'imtoolrc' try copying the above to $HOME/.imtoolrc or /usr/local/lib/imtoolrc) The Perl variable $iisframe is also exported from the module and controls which display frame number to use in programs such as Ximtool which supports multiple frames. This allows you to do useful things such as blink between images. The module communicates with the IIS device down FIFO pipes (special UNIX files) - unlike IRAF this module does a pretty decent job of intelligently guessing which file names to use for the pipes and will prompt for their creating if absent. Also if SAOimage or Ximtool are started from within Perl using the module this will guarantee correct file names! FUNCTIONS
iis Displays an image on a IIS device (e.g. SAOimage/Ximtool) iis $image, [ { MIN => $min, MAX => $max, TITLE => 'pretty picture', FRAME => 2 } ] iis $image, [$min,$max] (image(m,n),[\%options]) or (image(m,n),[min(),max()]) Displays image on a IIS device. If "min()" or "max()" are omitted they are autoscaled. A good demonstration of PDL threading can be had by giving "iis()" a data *cube* - "iis()" will be repeatedly called for each plane of the cube resulting in a poor man's movie! If supplied, "TITLE" is used to label the frame, if no title is supplied, either the "OBJECT" value stored in the image header or a default string is used (the title is restricted to a maximum length of 32 characters). To specify which frame to draw to, either use the package variable $iisframe, or the "FRAME" option. iiscur Return cursor position from an IIS device (e.g. SAOimage/Ximtool) ($x,$y) = iiscur($ch) This function puts up an interactive cursor on the IIS device and returns the "($x,$y)" position and the character typed ($ch) by the user. iiscirc Draws a circle on a IIS device (e.g. SAOimage/Ximtool) (x(),y(),radius(),colour()) iiscirc $x, $y, [$radius, $colour] Draws circles on the IIS device with specied points and colours. Because this module uses PDL::PP threading you can supply lists of points via 1D arrays, etc. An amusing PDL idiom is: pdl> iiscirc iiscur Note the colours are the same as IRAF, viz: 201 = cursor color (white) 202 = black 203 = white 204 = red 205 = green 206 = blue 207 = yellow 208 = cyan 209 = magenta 210 = coral 211 = maroon 212 = orange 213 = khaki 214 = orchid 215 = turquoise 216 = violet 217 = wheat saoimage Starts the SAOimage external program saoimage[(command line options)] Starts up the SAOimage external program. Default FIFO devices are chosen so as to be compatible with other IIS module functions. If no suitable FIFOs are found it will offer to create them. e.g.: pdl> saoimage pdl> saoimage( -geometry => '800x800' ) ximtool Starts the Ximtool external program ximtool[(command line options)] Starts up the Ximtool external program. Default FIFO devices are chosen so as to be compatible with other IIS module functions. If no suitable FIFOs are found it will offer to create them. e.g. pdl> ximtool pdl> ximtool (-maxColors => 64) BUGS
None known AUTHOR
Copyright (C) Karl Glazebrook 1997. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. perl v5.14.2 2012-05-30 IIS(3pm)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy