From: "Steven Levine" Received: from [192.168.100.201] (HELO mail.2rosenthals.com) by 2rosenthals.com (CommuniGate Pro SMTP 5.4.10) with ESMTP id 13712494 for ecs-isp@2rosenthals.com; Tue, 29 Jul 2025 20:20:53 -0400 Received: from [192.168.200.201] (port=53638 helo=mail2.2rosenthals.com) by mail.2rosenthals.com with esmtp (Exim 4.97.1) (envelope-from ) id 1uguYt-000000007sS-0Asg for ecs-isp@2rosenthals.com; Tue, 29 Jul 2025 20:20:51 -0400 Received: from mta-102a.earthlink-vadesecure.net ([51.81.61.66]:51451) by mail2.2rosenthals.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1uguYq-000000005LZ-1u3e for ecs-isp@2rosenthals.com; Tue, 29 Jul 2025 20:20:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; bh=B+9UuUpXgeTILDs5N1/iS4tsO9hZO9ydOTgg1X KWiek=; c=relaxed/relaxed; d=earthlink.net; h=from:reply-to:subject: date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to: references:list-id:list-help:list-unsubscribe:list-unsubscribe-post: list-subscribe:list-post:list-owner:list-archive; q=dns/txt; s=dk12062016; t=1753834848; x=1754439648; b=nejszm5vLMtcxiU9qu/e3rQpMgm 0DYTCmJ2Cobo6oQ8102NoI+TXYW9dwvPBioFvkv+uEsEcsSFIg17+3yZ+FTcrhRKENY8feh dwr7/q2/AtcjEZWJTwWcqFrOZ5XOvodyjTjvgjNg6PueSj6oaOicNvkhQpzhuPxtLEGn/lN yDX2FO42gY0cqWxxQF/ObahD1LY8VMXaeXbkqosUUpNQTIHClp1UjVhHOa3ZJguf1ExcJ4M VhaVNYaXntYIcZdMoSfdNaPambKMh8FGDV91CTCQihCErPdz0eOgo9Tx/mbrPoUzreGUBJc imCbnXD0t8IAht7I9hrApTfM8P2mRPA== Received: from slamain ([172.58.119.142]) by vsel1nmtao02p.internal.vadesecure.com with ngmta id 91310b63-1856df8082d2552a; Wed, 30 Jul 2025 00:20:48 +0000 Message-ID: <68895876.52.mr2ice.fgrirsq@earthlink.net> Date: Tue, 29 Jul 2025 16:25:42 -0700 To: "eCS ISP Mailing List" In-Reply-To: Subject: Re: [eCS-ISP] socket - no buffer space availble Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Mailer: MR/2 Internet Cruiser Edition for OS/2 v3.00.11.24/60 In , on 07/29/25 at 07:45 PM, "Massimo S." said: Hi Massimo, >> =A0=A0=A0=A0 0 STREAM=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 42164=A0=A0=A0=A0= =A0=A0=A0 http..80 217.182.195.225=A0 FIN_WAIT_2 >> =A0=A0=A0=A0 0 STREAM=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 56842=A0=A0=A0=A0= =A0 https..443=A0=A0=A0 103.42.4.140=A0 FIN_WAIT_2 >> =A0=A0=A0=A0 0 STREAM=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 18331=A0=A0=A0=A0= =A0=A0=A0 http..80=A0=A0 51.68.111.239=A0 FIN_WAIT_2 >> =A0=A0=A0=A0 0 STREAM=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 62505=A0=A0=A0=A0= =A0=A0=A0 http..80=A0 91.225.160.193=A0 FIN_WAIT_2 >FIN_WAIT_2 has no universally mandated timeout in TCP protocol, so some >OSes keep these sockets indefinitely without cleanup. This may have been true at one time. However, all the examples I'm seem imply that the current default timeout is 60 seconds. Also, looking that= the FreeBSD 3.2 sources which are very close to the code used to port the= stack we use, I'm pretty sure can see where the timeout is set to 2 times= the Maximum Segment Lifetime which would be 2 minutes on a system with th= e default settings. >I add, that i've seen that even closing apache the hundreds of sockets >stay in FIN_WAIT_2 and do not disappear How long did you wait? I would not be surprised if the timeout was 2 minutes. You can try the attached and see if it can deal with the sockets stuck in= FIN_WAIT_2. It's basically a manual version of socktidy. Run it as CloseSocket and give it a list of sockets to close. I've never tested it against FIN_WAIT_2 sockets, so it might have no ettect. Steven -- ---------------------------------------------------------------------- "Steven Levine" Warp/DIY/BlueLion etc. www.scoug.com www.arcanoae.com www.warpcave.com ---------------------------------------------------------------------- /* CloseSocket - close socket Copyright (c) 2002-2017 Steven Levine and Associates, Inc. All rights reserved. 2001-06-14 SHL - Release 2014-06-12 SHL Sync with templates 2016-10-19 SHL Sync with templates 2017-11-30 SHL Correct typo 2017-11-30 SHL Convert to Globals style 2017-11-30 SHL Sync with templates */ signal on Error signal on Failure name Error signal on Halt signal on NotReady name Error signal on NoValue name Error signal on Syntax name Error gVersion =3D '0.1'; Globals =3D 'gArgList. gCmdName gDbgLvl gErrCondition gSock. gVersion' call Initialize Main: /* Load socket functions */ call RxFuncAdd 'SockLoadFuncs','rxSock','SockLoadFuncs' call SockLoadFuncs 0 parse arg cmdLine call ScanArgs cmdLine drop cmdLine do iArg =3D 1 to gArgList.0 gSock.!Socket =3D gArgList.iArg call DoClose end exit 0 /* end main */ /*=3D=3D=3D DoClose() Close socket =3D=3D=3D*/ DoClose: procedure expose (Globals) say 'Closing socket' gSock.!Socket call SockCloseX return 0 /* end DoClose */ /*=3D=3D=3D Initialize() Initialize globals =3D=3D=3D*/ Initialize: call LoadRexxUtil call GetCmdName call SockLoadRxSock return /* end Initialize */ /*=3D=3D=3D ScanArgsInit() ScanArgs initialization exit routine =3D=3D=3D= */ ScanArgsInit: procedure expose (Globals) cmdTail swCtl keepQuoted /* Preset defaults */ gDbgLvl =3D 0 gArgList.0 =3D 0 /* Reset arg count */ return /* end ScanArgsInit */ /*=3D=3D=3D ScanArgsSwitch() ScanArgs switch option exit routine =3D=3D=3D= */ ScanArgsSwitch: procedure expose (Globals) curSw curSwArg select when curSw =3D=3D 'h' | curSw =3D=3D '?' then call ScanArgsHelp when curSw =3D=3D 'V' then do say gCmdName gVersion exit end otherwise call ScanArgsUsage 'switch '''curSw''' unexpected' end /* select */ return /* end ScanArgsSwitch */ /*=3D=3D=3D ScanArgsArg() ScanArgs argument option exit routine =3D=3D=3D= */ ScanArgsArg: procedure expose (Globals) curArg i =3D gArgList.0 + 1 gArgList.i =3D curArg gArgList.0 =3D i return /* end ScanArgsArg */ /*=3D=3D=3D ScanArgsTerm() ScanArgs scan end exit routine =3D=3D=3D*/ ScanArgsTerm: procedure expose (Globals) if gArgList.0 =3D 0 then call ScanArgsUsage 'required arguments missing' return /* end ScanArgsTerm */ /*=3D=3D=3D ScanArgsHelp() Display ScanArgs usage help exit routine =3D=3D= =3D*/ ScanArgsHelp: say say 'Try to close selected sockets.' say say 'Usage:' gCmdName '[-h] [-V] [-?] socket...' say say ' -h -? Display this message' say ' -V Display version number and quit' say say ' socket Socket to close' exit 255 /* end ScanArgsHelp */ /*=3D=3D=3D ScanArgsUsage(message) Report Scanargs usage error exit routi= ne =3D=3D=3D*/ ScanArgsUsage: parse arg msg say if msg \=3D=3D '' then say msg say 'Usage:' gCmdName '[-h] [-V] [-?] socket...' exit 255 /* end ScanArgsUsage */ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D*/ /*=3D=3D=3D SkelRexxFunc standards - Delete unused - Move modified above = this mark =3D=3D=3D*/ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D*/ /*=3D=3D=3D DbgMsg([level, ]message,...) Write multi-line message to STDE= RR if debugging =3D=3D=3D*/ DbgMsg: procedure expose (Globals) level =3D arg(1) if datatype(level, 'W') then start =3D 2 else do level =3D 1 start =3D 1 end if level <=3D gDbgLvl then do do i =3D start to arg() msg =3D arg(i) if msg \=3D=3D '' then msg =3D ' *' msg call lineout 'STDERR', msg end end return /* end DbgMsg */ /*=3D=3D=3D SockCloseX() SockClose wrapper =3D=3D=3D*/ SockCloseX: procedure expose (Globals) call DbgMsg 2, 'SockCloseX: closing' gSock.!Socket gSock.!rc =3D SockClose(gSock.!Socket) s =3D gSock.!Socket drop gSock.!Socket /* Drop now to avoid recursion */ if gSock.!rc < 0 then call SockError 'Close' s return /* end SockCloseX */ /*=3D=3D=3D SockDump() Dump gSock. stem content =3D=3D=3D*/ SockDump: procedure expose gSock. SIGL crlf =3D '0d0a'x s =3D '' || crlf || ' * Dumping gSock.' if symbol('SIGL') =3D=3D 'VAR' then s =3D s 'at line' SIGL s =3D s 'on' date() time('L') || crlf s2 =3D s if symbol('gSock.!HostName') =3D=3D 'VAR' then s =3D s || ' * HostName:' gSock.!HostName || crlf if symbol('gSock.!Socket') =3D=3D 'VAR' then s =3D s || ' * Socket:' gSock.!Socket || crlf if symbol('gSock.!ListenSocket') =3D=3D 'VAR' then s =3D s || ' * ListenSocket:' gSock.!ListenSocket || crlf if symbol('gSock.!Host.!name') =3D=3D 'VAR' then s =3D s || ' * Host.!name:' gSock.!Host.!name || crlf if symbol('gSock.!Host.!port') =3D=3D 'VAR' then s =3D s || ' * Host.!port:' gSock.!Host.!port || crlf if symbol('gSock.!Host.!family') =3D=3D 'VAR' then s =3D s || ' * Host.!family:' gSock.!Host.!family || crlf if symbol('gSock.!Host.!addr') =3D=3D 'VAR' then s =3D s || ' * Host.!addr:' gSock.!Host.!addr || crlf /* If have useful data, show it */ if s \=3D=3D s2 then call lineout 'STDERR', s return /* end SockDump */ /*=3D=3D=3D SockError(request) Report socket error and shutdown or return= =3D=3D=3D*/ /* Action depends on gSock.!ErrorAction setting ABORT - errors are reported, sockets are closed and script exits REPORT - errors are reported and the function returns to the caller IGNORE - errors are not reported the function returns to the caller the default action is abort */ SockError: if symbol('gSock.!ErrorAction') =3D=3D 'VAR' then action =3D translate(gSock.!ErrorAction) else action =3D 'ABORT' if action =3D 'IGNORE' then return parse arg req if req =3D=3D '' then req =3D 'Socket request' else req =3D 'Sock' || req call lineout 'STDERR', '' call lineout 'STDERR', gCmdName':' req 'failed at line' SIGL 'on' date(= ) time('L') if symbol('gSock.!rc') =3D=3D 'VAR' then call lineout 'STDERR', gCmdName': gSock.!rc:' gSock.!rc 'errno:' errn= o 'h_errno:' h_errno else call lineout 'STDERR', gCmdName':' 'errno:' errno 'h_errno:' h_errno call SockDump if action =3D 'REPORT' then return if action \=3D 'ABORT' then call lineout 'STDERR', ' Action:' action 'unexpected' /* Action is abort */ if symbol('gSock.!Socket') =3D=3D 'VAR' then call SockCloseX if symbol('gSock.!ListenSocket') =3D=3D 'VAR' then call SockCloseListen call beep 200, 300 exit 253 /* end SockError */ /*=3D=3D=3D SockLoadRxSock() Load RxSock functions =3D=3D=3D*/ SockLoadRxSock: if RxFuncQuery('SockLoadFuncs') then do call RxFuncAdd 'SockLoadFuncs', 'RXSOCK', 'SockLoadFuncs' if RESULT then call Die 'Cannot load SockLoadFuncs' call SockLoadFuncs 0 end return /* end SockLoadRxSock */ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= */ /*=3D=3D=3D SkelRexx standards - Delete unused - Move modified above this= mark =3D=3D=3D*/ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= */ /*=3D=3D=3D Error() Set gErrCondition; report to STDOUT; trace and exit o= r return if called =3D=3D=3D*/ Error: say parse source . . cmd gErrCondition =3D condition('C') say gErrCondition 'signaled at line' SIGL 'of' cmd'.' if condition('D') \=3D '' then say 'REXX reason =3D' condition('D')'.' if gErrCondition =3D=3D 'SYNTAX' & symbol('RC') =3D=3D 'VAR' then say 'REXX error =3D' RC '-' errortext(RC)'.' else if symbol('RC') =3D=3D 'VAR' then say 'RC =3D' RC'.' say 'Source =3D' sourceline(SIGL) if condition('I') \=3D=3D 'CALL' | gErrCondition =3D=3D 'NOVALUE' | gEr= rCondition =3D=3D 'SYNTAX' then do trace '?A' say 'Enter REXX commands to debug failure. Press enter to exit scrip= t.' nop if symbol('RC') \=3D=3D 'VAR' then RC =3D 255 exit RC end return /* end Error */ /*=3D=3D=3D Die([message,...]) Write multi-line message to STDERR and die= =3D=3D=3D*/ Die: call lineout 'STDERR', '' do i =3D 1 to arg() call lineout 'STDERR', arg(i) end call lineout 'STDERR', gCmdName 'aborting at script line' SIGL call beep 200, 300 call SysSleep 2 exit 254 /* end Die */ /*=3D=3D=3D GetCmdName() Get short script name and set gCmdName =3D=3D=3D= */ GetCmdName: procedure expose (Globals) parse source . . cmd cmd =3D filespec('N', cmd) /* Chop path */ c =3D lastpos('.', cmd) if c > 1 then cmd =3D left(cmd, c - 1) /* Chop extension */ gCmdName =3D translate(cmd, xrange('a', 'z'), xrange('A', 'Z')) /* Lowe= rcase */ return /* end GetCmdName */ /*=3D=3D=3D Halt() Report HALT condition to STDOUT and exit =3D=3D=3D*/ Halt: say parse source . . cmd say condition('C') 'signaled at' cmd 'line' SIGL'.' say 'Source =3D' sourceline(SIGL) say 'Sleeping for 2 seconds...' call SysSleep 2 exit 253 /* end Halt */ /*=3D=3D=3D LoadRexxUtil() Load RexxUtil functions =3D=3D=3D*/ LoadRexxUtil: if RxFuncQuery('SysLoadFuncs') then do call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' if RESULT then call Die 'Cannot load SysLoadFuncs' call SysLoadFuncs end return /* end LoadRexxUtil */ /*=3D=3D=3D ScanArgs(cmdLine) Scan command line =3D=3D=3D*/ ScanArgs: procedure expose (Globals) /* Calls user exits to process arguments and switches */ parse arg cmdTail cmdTail =3D strip(cmdTail) call ScanArgsInit /* Ensure optional settings initialized */ if symbol('SWCTL') \=3D=3D 'VAR' then swCtl =3D '' /* Switches that take args, append ? if optional */ if symbol('KEEPQUOTED') \=3D=3D 'VAR' then keepQuoted =3D 0 /* Set to 1 to keep arguments quoted */ /* Scan */ curArg =3D '' /* Current arg string */ curSwList =3D '' /* Current switch list */ /* curSwArg =3D '' */ /* Current switch argument, if needed */ noMoreSw =3D 0 /* End of switches */ do while cmdTail \=3D=3D '' | curArg \=3D=3D '' | curSwList \=3D=3D '' if curArg =3D=3D '' then do /* Buffer empty, refill */ qChar =3D left(cmdTail, 1) /* Remember quote */ if \ verify(qChar,'''"', 'M') then parse var cmdTail curArg cmdTail /* Not quoted */ else do /* Arg is quoted */ curArg =3D '' do forever /* Parse dropping quotes */ parse var cmdTail (qChar)quotedPart(qChar) cmdTail curArg =3D curArg || quotedPart /* Check for escaped quote within quoted string (i.e. "" or '') */ if left(cmdTail, 1) \=3D=3D qChar then leave /* No, done */ curArg =3D curArg || qChar /* Append quote */ if keepQuoted then curArg =3D curArg || qChar /* Append escaped quote */ parse var cmdTail (qChar) cmdTail end /* do */ if keepQuoted then curArg =3D qChar || curArg || qChar /* requote */ end /* if quoted */ end /* If switch buffer empty, refill */ if curSwList =3D=3D '' then do if left(curArg, 1) =3D=3D '-' & curArg \=3D=3D '-' then do if noMoreSw then call ScanArgsUsage 'switch '''curArg''' unexpected' else if curArg =3D=3D '--' then noMoreSw =3D 1 else do curSwList =3D substr(curArg, 2) /* Remember switch string */ curArg =3D '' /* Mark empty */ iterate /* Refill arg buffer */ end parse var cmdTail curArg cmdTail end end /* If switch in progress */ if curSwList \=3D=3D '' then do curSw =3D left(curSwList, 1) /* Next switch */ curSwList =3D substr(curSwList, 2) /* Drop from pending */ /* Check switch allows argument, avoid matching ? */ if pos(curSw, translate(swCtl,,'?')) \=3D 0 then do if curSwList \=3D=3D '' then do curSwArg =3D curSwList /* Use rest of switch string for switch argume= nt */ curSwList =3D '' end else if curArg \=3D=3D '' & left(curArg, 1) \=3D=3D '-' then do curSwArg =3D curArg /* Arg string is switch argument */ curArg =3D '' /* Mark arg string empty */ end else if pos(curSw'?', swCtl) =3D 0 then call ScanArgsUsage 'Switch' curSw 'requires argument' else curSwArg =3D '' /* Optional arg omitted */ end call ScanArgsSwitch /* Passing curSw and curSwArg */ drop curSwArg /* Must be used by now */ end /* if switch */ /* If arg */ else if curArg \=3D=3D '' then do noMoreSw =3D 1 call ScanArgsArg /* Passing curArg */ curArg =3D '' end end /* while not done */ call ScanArgsTerm return /* end ScanArgs */ /* The end */