.
D 2000-10-26T00:45:23
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s2322\sBug\nVersion:\s8.1.1\nSubmitDate:\s'1999-07-06'\nLastModified:\s'1999-08-05'\nSeverity:\sCRIT\nStatus:\sClosed\nSubmitter:\stechsupp\nChangedBy:\shobbs\nRelatedBugIDs:\s2328\nOS:\sWindows\s95\nMachine:\sX86\nFixedDate:\s'2000-10-25'\nClosedDate:\s'1999-08-05'\n\n\nName:\nMartin\sConrad\n\nCustomShell:\nno\n\nReproducibleScript:\nI\sdeveloped\s2\sscripts.\sOne\simplements\sa\scommand\sserver,\sone\sa\sclient.\n\s\s\s\sThe\sserver\soffers\sa\scommand\sshell\sto\sthe\sclient,\srunning\son\sthe\sserver.\n\s\s\s\sThe\scommand\sshell\sis\scommand\s(Win\s95),\scmd\s(Win\sNT)\sor\ssh\s(Unix/Linux).\n\s\s\s\s\n\s\s\s\sWhenever\sat\sleast\sone\sconnection\sfrom\sa\sclient\shas\sbeen\sestablished,\sthe\n\s\s\s\sserver\scan't\sbe\sstopped.\sThis\sis\strue\safter\slegal\sdisconnect\s(see\sthe\n\s\s\s\sserver\sscript),\sas\s<Cntrl-C>\sdoesn't\swork.\sIn\sthat\scase,\syou\scan\sonly\n\s\s\s\suse\sthe\stask\smanager\sto\sstop\sthe\sapplication,\sbut\sshutdown\shangs.\n\s\s\s\s\n\s\s\s\sTo\sstart\sthe\sscripts,\syou\sneed\stwo\scommand\swindows.\sIn\sone,\stype\n\s\s\s\s\n\s\s\s\stclsh81\scmdserver.tc\s4711\n\s\s\s\s\n\s\s\s\sIn\sthe\sother,\stype\n\s\s\s\s\n\s\s\s\stclsh81\scmdclient.tc\sname\s4711\n\s\s\s\s\n\s\s\s\swhere\s"name"\sis\sthe\shost\sname\s(e.g."localhost",\sif\syou\stest\son\sone\n\s\s\s\scomputer).\s4711\sis\sthe\sport\snumber,\syou\scan\suse\sany\sfree\sport\snumber,\n\s\s\s\s4711\sis\sonly\sone\sexample.\n\s\s\s\s\n\s\s\s\sOn\sthe\sclient,\syou\scan\stype\sin\sa\scommand,\s"exit"\sto\sfinish\sthe\n\s\s\s\scommunication.\n\s\s\s\s\n\s\s\s\sHere\sthe\stwo\sscripts:\n\s\s\s\s\n\s\s\s\s-----------------------------------------------------\sCmdServer.tc:\n\s\s\s\s\n\s\s\s\s#!\s/usr/local/bin/tclsh\n\s\s\s\s\n\s\s\s\sif\s{$argc\s!=\s1}\s{\n\s\s\s\sputs\s{Syntax:\scmdserver\sport}\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\sif\s[catch\s{expr\s[lindex\s$argv\s0]\s+\s0}\sport]\s{\n\s\s\s\sputs\s{Syntax:\scmdserver\sport}\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\sputs\s"cmdserver\s0.1"\n\s\s\s\s\n\s\s\s\sproc\sservice\s{fdx\shost\sport}\s{\n\s\s\s\sglobal\sX\sSH\stcl_platform\sfds\sfd1\sY\n\s\s\s\s\n\s\s\s\sset\sfds\s$fdx\n\s\s\s\sputs\s"Connect\sfrom\s$host:$port"\n\s\s\s\sfconfigure\s$fds\s-blocking\s0\s-buffering\snone\s-translation\s{auto\slf}\n\s\s\s\sif\s{[string\scompare\s"$tcl_platform(platform)"\s"windows"]\s==\s0}\s{\n\s\s\s\sset\sfd1\s[open\s"|\scmd"\sr+]\n\s\s\s\s}\selse\s{\n\s\s\s\sset\sfd1\s[open\s{|\ssh\s-c\s"exec\ssh\s-i\s2>&1"}\sr+]\n\s\s\s\s}\n\s\s\s\sfconfigure\s$fd1\s-blocking\s0\s-buffering\snone\s-translation\s{auto\sauto}\n\s\s\s\sfileevent\s$fd1\sreadable\s{\n\s\s\s\sset\sxxx\s[read\s$fd1\s100]\n\s\s\s\sputs\s-nonewline\s$fds\s$xxx\n\s\s\s\sif\s[eof\s$fd1]\s{\n\s\s\s\sfileevent\s$fds\sreadable\s{}\n\s\s\s\sfileevent\s$fd1\sreadable\s{}\n\s\s\s\sset\sY\s1\n\s\s\s\s}\n\s\s\s\s}\n\s\s\s\sfileevent\s$fds\sreadable\s{\n\s\s\s\sset\syyy\s[read\s$fds\s100]\n\s\s\s\sputs\s-nonewline\s$fd1\s$yyy\n\s\s\s\sif\s[eof\s$fds]\s{\n\s\s\s\sfileevent\s$fds\sreadable\s{}\n\s\s\s\sfileevent\s$fd1\sreadable\s{}\n\s\s\s\sset\sY\s2\n\s\s\s\s}\n\s\s\s\s}\n\s\s\s\svwait\sY\n\s\s\s\sif\s{$Y\s==\s1}\s{\n\s\s\s\sputs\s"Disconnecting\s$host:$port"\n\s\s\s\s}\selse\s{\n\s\s\s\sputs\s"Disconnect\sfrom\s$host:$port"\n\s\s\s\s}\n\s\s\s\scatch\s{close\s$fd1}\n\s\s\s\sclose\s$fds\n\s\s\s\s}\n\s\s\s\s#\ssetup\sglobal\svariables\sused\sfrom\sservice\sproc\n\s\s\s\sset\sfds\s0\n\s\s\s\sset\sfd1\s1\n\s\s\s\sset\sY\s\s\s0\n\s\s\s\sset\sX\s1\n\s\s\s\sset\sfd\s[socket\s-server\sservice\s[lindex\s$argv\s0]]\n\s\s\s\svwait\sX\n\s\s\s\s\n\s\s\s\s-----------------------------------------------------\sCmdClient.tc:\n\s\s\s\s\n\s\s\s\s#!\s/usr/local/bin/tclsh\n\s\s\s\s\n\s\s\s\sif\s{$argc\s!=\s2}\s{\n\s\s\s\sputs\s{Syntax:\scmdclient\shost\sport}\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\sif\s[catch\s{expr\s[lindex\s$argv\s1]\s+\s0}\sport]\s{\n\s\s\s\sputs\s{Syntax:\scmdclient\shost\sport\s[cr|lf|crlf]}\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\sputs\s"cmdclient\s0.1"\n\s\s\s\sset\sfd\s[socket\s[lindex\s$argv\s0]\s[lindex\s$argv\s1]]\n\s\s\s\sfconfigure\s$fd\s-blocking\s0\s-buffering\snone\s-translation\s{binary\sbinary}\n\s\s\s\sfconfigure\sstdin\s-blocking\s0\s-buffering\snone\s-translation\sauto\n\s\s\s\sfconfigure\sstdout\s-blocking\s0\s-buffering\snone\s-translation\scrlf\n\s\s\s\sfileevent\s$fd\sreadable\s{\n\s\s\s\sset\syyy\s[read\s$fd\s100]\n\s\s\s\sputs\s-nonewline\s$yyy\n\s\s\s\sif\s[eof\s$fd]\s{\n\s\s\s\sputs\s"Connection\slost"\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\s}\n\s\s\s\sfileevent\sstdin\sreadable\s{\n\s\s\s\sset\sxxx\s[read\sstdin\s100]\n\s\s\s\sputs\s-nonewline\s$fd\s$xxx\n\s\s\s\sif\s[eof\sstdin]\s{\n\s\s\s\sexit\n\s\s\s\s}\n\s\s\s\s}\n\s\s\s\sset\sFOREVER\s0\n\s\s\s\svwait\sFOREVER\n\s\s\s\s\n\s\s\s\s-----------------------------------------------------\s\n\s\s\s\s\n\s\s\s\sBest\sregards,\n\s\s\s\s\n\s\s\s\sMartin\n\nObservedBehavior:\nIt\sisn't\spossible\sto\sstop\sthe\sserver\sscript:\s<Cntrl-C>\sdoesn't\swork.\n\s\s\s\sShutdown\sis\shanging.\n\nDesiredBehavior:\n<Cntrl-C>\sshould\sstop\sthe\sserver\sscript.\sAs\sbad\salternative,\sit\swould\sbe\n\s\s\s\sacceptable,\sthat\sthe\stask\smanager\smust\sbe\sused\sto\skill\sthe\sapplication.\n\s\s\s\sThe\sshutdown\smust\snot\shang.\n\n\n\n
J foundin final:\s8.1.1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title Tcl\serror\swith\ssocket\s/\spine\scombination\sunder\sWin\s95
J type Bug
K 217885ffffffffffffffffffffffffffffffffff
U nobody
Z 15582d14dec28b3a8115645a5d4026c0