Skip to content
Tcl Source Code Artifact [bbb039400b]
Login

Artifact [bbb039400b]

Artifact bbb039400bc88b9544956e89076573161a1ef248:

Ticket change [bbb039400b] - New ticket [218121ffffffffff|218121ffff] <i>Opening a socket to an IP that is not in use should time out</i>. by nobody on 2000-10-26 00:53:22.
D 2000-10-26T00:53:22
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1950\sBug\nVersion:\s8.0.4\nSubmitDate:\s'1999-04-27'\nLastModified:\s'1999-08-08'\nSeverity:\sMED\nStatus:\sClosed\nSubmitter:\spat\nChangedBy:\shobbs\nOS:\sAll\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'2000-10-25'\nFixedInVersion:\sNA\nClosedDate:\s'1999-08-08'\n\n\nFrom:\[email protected]\s(vipvop)\nSubject:\sbug\sin\sTCL/TK\s8.0.4\sfor\sWin95\s-\sdeals\swith\ssocket\n\nI\stried\sto\sreport\sthis\sto\sthe\sperson\sit\ssays\n([email protected])\sin\sthe\sreadme\sfile,\sbut\sin\scame\sback\suser\nunknown\sso\sIm\sposting\sit\shere.\s\sI\sdont\susually\scheck\sthis\sgroup\sso\nfogive\sme\sif\sits\salready\sbeen\sreported.\sThe\sproblem\sis\swhen\syou\stry\sto\nopen\sa\ssocket\sto\san\sIP\saddress\sthat\sisnt\scurrently\sin\suse,\sor\sdoesnt\nhave\sthe\sport\syou\sare\strying\sto\sconnect\sto\sopen.\sInstead\sof\stiming\sout\nafter\sa\sfew\sseconds,\slike\sit\sdoes\sin\sthe\slinux\sversion,\sit\sjust\swaits\nseemingly\sforever\s(after\sa\smin\sI\sgive\sup\sand\sjust\sctrl-alt-del\sit).\nHeres\sthe\scode\sthat\sworks\sin\slinux,\sbut\snot\sin\sWin95.\n\n#!/usr/bin/tclsh\nset\sendip\s100\nwhile\s{$endip\s<\s131}\s{\n\s\s\sset\saddr\s207.137.46.$endip\n\s\s\sputs\s"Trying\s$addr"\n\s\s\sif\s[catch\s{set\ssockid\s[socket\s$addr\s80]}]\s{set\ssockid\s0}\n\s\s\sif\s[string\smatch\s"sock*"\s$sockid]\s{puts\s"Open\sport\s80\sat:\s$addr\s"}\n\s\s\sset\sendip\s[expr\s$endip\s+\s1]\n\s\s\sif\s[string\smatch\s"sock*"\s$sockid]\s{close\s$sockid}\n}\nputs\s"All\sdone!"\n\nThat\sis\smeant\sto\sfind\smy\sfriends\sweb\sserver,\she\shas\sa\sdynamic\sIP\naddress\sand\snow\sthat\smonoliths\s.dyn.ml.org\sgot\sshut\sdown\sits\sthe\sonly\nway\sto\sfind\shis\saddress\sout,\sby\strying\sall\sof\sthem\sin\sthat\srange.\nThe\sbug\sspecifically\sis\sthe\sline:\n\s\s\sif\s[catch\s{set\ssockid\s[socket\s$addr\s80]}]\s{set\ssockid\s0}\n\nTcl\suses\sthe\splatforms\sstandard\stimeout\s(usually\sabout\s1\smin),\nand\sthis\sworks\sas\stested\s(it\stimes\sout)\son\sWindows\sas\swell.\nThe\suser\sprobably\sdidn't\swait\slong\senough\sbecause\sit\sdoes\sjust\nhang\sin\sthe\sinterim.\s\n--\s08/08/1999\shobbs
J foundin obsolete:\s8.0.4
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 63.\s(unused)
J title Opening\sa\ssocket\sto\san\sIP\sthat\sis\snot\sin\suse\sshould\stime\sout
J type Bug
K 218121ffffffffffffffffffffffffffffffffff
U nobody
Z dce3401939c740f65592efd5cbb6157d