Skip to content
Tcl Source Code Artifact [ad13b01c0a]
Login

Artifact [ad13b01c0a]

Artifact ad13b01c0a5c74e8c609e0e58fa9e1a3910b519e:

Ticket change [ad13b01c0a] - New ticket [218945ffffffffff|218945ffff] <i>[fconfigure $socket -error] broken</i>. by nobody on 2000-10-26 01:08:27.
D 2000-10-26T01:08:27
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s2868\sBug\nVersion:\s8.2\nSubmitDate:\s'1999-09-23'\nLastModified:\s'1999-09-29'\nSeverity:\sSER\nStatus:\sReleased\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sWindows\s95\nMachine:\sX86\nFixedDate:\s'1999-09-28'\nFixedInVersion:\s8.2.1\nClosedDate:\s'2000-10-25'\n\n\nName:\nDon\sPorter\n\nReproducibleScript:\n#!/bin/sh\n\s\s\s\s#\sFILE:\sasync\n\s\s\s\s#\sUsage:\sasync\s<host>\s<port>\n\s\s\s\s#\s\sexec\stclsh\s"$0"\s${1+"$@"}\n\s\s\s\s\n\s\s\s\sproc\sAsyncConnect\s{host\sport}\s{\n\s\s\s\s\s\s\s\sputs\s"creating\ssocket..."\n\s\s\s\s\s\s\s\sset\ss\s[socket\s-async\s$host\s$port]\n\s\s\s\s\s\s\s\sputs\s"socket\screated"\n\s\s\s\s\s\s\s\sfileevent\s$s\swritable\s[list\sVerifyConnection\s$s\s$host\s$port]\n\s\s\s\s}\n\s\s\s\s\n\s\s\s\sproc\sVerifyConnection\s{s\shost\sport}\s{\n\s\s\s\s\s\s\s\sglobal\sconnected\n\s\s\s\s\s\s\s\sfileevent\s$s\swritable\s{}\n\s\s\s\s\n\s\s\s\s\s\s\s\s#\sIf\sthere's\san\serror\scondition\son\sthe\ssocket\s(failure\sto\sconnect),\n\s\s\s\s\s\s\s\s#\sthen\s[fconfigure\s-error]\sshould\sprovide\san\serror\smessage\n\s\s\s\s\s\s\s\s#\n\s\s\s\s\s\s\s\sset\smsg\s[fconfigure\s$s\s-error]\n\s\s\s\s\s\s\s\sif\s{![string\smatch\s{}\s$msg]}\s{\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"Connection\sto\s$host:$port\sfailed:\s$msg"\n\s\s\s\s\s\s\s\s\s\s\s\sset\sconnected\s0\n\s\s\s\s\s\s\s\s\s\s\s\scatch\s{close\s$s}\n\s\s\s\s\s\s\s\s\s\s\s\sreturn\n\s\s\s\s\s\s\s\s}\n\s\s\s\s\n\s\s\s\s\s\s\s\s#\sConnection\sreportedly\ssuccessful.\s\sAt\sthis\spoint\swe\snormally\n\s\s\s\s\s\s\s\s#\sconfigure\sthe\ssocket\sfor\swhatever\scommunications\swe\swant\sand\n\s\s\s\s\s\s\s\s#\sset\sup\sfileevent\shandlers\sto\smanage\sprotocols\sover\sthe\ssocket.\n\s\s\s\s\s\s\s\s#\n\s\s\s\s\s\s\s\s#\sHere,\sas\sa\ssimple\scheck,\sprint\sout\sthe\speername\sinformation\n\s\s\s\s\s\s\s\s#\sas\sa\scheck\sof\sa\sgood\sconnection.\s\sIf\swe\sreally\sare\sconnected,\n\s\s\s\s\s\s\s\s#\swe\sprint\sinformation\sabout\sthe\sfar\send\sof\sthe\sconnection.\s\sIf\n\s\s\s\s\s\s\s\s#\snot,\sprint\san\serror\smessage\sindicating\sthat\sTcl's\sfileevent,\n\s\s\s\s\s\s\s\s#\sfconfigure,\sand\ssocket\sare\snot\sworking\sas\sadvertised.\n\s\s\s\s\s\s\s\s#\n\s\s\s\s\s\s\s\sif\s{[catch\s{fconfigure\s$s\s-peername}\speerInfo]}\s{\n\s\s\s\sputs\s"Tcl\sis\sbroken:\s$peerInfo"\n\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\sputs\s"Connected:\s$peerInfo"\n\s\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\sset\sconnected\s1\n\s\s\s\s\s\s\s\sclose\s$s\n\s\s\s\s}\n\s\s\s\s\n\s\s\s\sproc\stick\s{}\s{\n\s\s\s\s\s\s\s\s#\sDemonstrate\sevent\sloop\sis\sactive,\sand\sprovide\seventual\stimeout\n\s\s\s\s\s\s\s\sglobal\stick\sconnected\n\s\s\s\s\s\s\s\sincr\stick\n\s\s\s\s\s\s\s\sputs\s"tick\s$tick"\n\s\s\s\s\s\s\s\sif\s{$tick\s>=\s6000}\s{set\sconnected\s0;\sreturn}\n\s\s\s\s\s\s\s\safter\s10\stick\n\s\s\s\s}\n\s\s\s\s\n\s\s\s\sset\sconnected\s0\n\s\s\s\sset\stick\s0\n\s\s\s\stick\n\s\s\s\seval\sAsyncConnect\s$argv\n\s\s\s\svwait\sconnected\n\s\s\s\s#\sEND\sFILE:\sasync\n\nObservedBehavior:\nC:>\stclsh82\sasync\swww.w3.org\s90\n\s\s\s\stick\s1\n\s\s\s\screating\ssocket...\n\s\s\s\ssocket\screated\n\s\s\s\stick\s2\n\s\s\s\s...\n\s\s\s\stick\s895\n\s\s\s\sTcl\sis\sbroken:\scan't\sget\speername:\ssocket\sis\snot\sconnected\n\nDesiredBehavior:\nIf\sthe\ssocket\sis\snot\sconnected,\sI\sexpect\s[fconfigure\s$socket\s-error]\n\s\s\s\sto\sreturn\sa\snon-empty\serror\smessage,\sso\sthat\sfailure\sto\sconnect\scan\n\s\s\s\sbe\sdetected\sby\sthe\scallback\sroutine\safter\sa\s[socket\s-async\s$host\s$port].\n\s\s\s\s\n\s\s\s\sCurrently\sit\sappears\sthe\sonly\sway\sto\scheck\sthe\ssocket\sfor\sa\ssuccessful\n\s\s\s\sconnection\sis\sto\scatch\s[fconfigure\s$socket\s-peername].\s\sThat\sis\san\n\s\s\s\sexpensive\soperation\swhich\smay\sblock\sfor\sawhile.\s\sIf\sI\sdidn't\smind\n\s\s\s\sblocking,\sI\swouldn't\sbe\susing\s[socket\s-async]\sin\sthe\sfirst\splace.\n\n\n\nI\sam\smoving\sthis\sto\seither\sfixed\s(or\sclosed)\sfor\s8.2.1,\sbecause\sit\ngives\sme:\n\n(tkcon)\s51\s%\sAsyncConnect\spop\s90\ncreating\ssocket...\nsocket\screated\n##\ssome\swaiting\soccurs\shere\nConnection\sto\spop:90\sfailed:\sconnection\srefused\n\nWhich\sseems\sto\sbe\swhat\sthe\suser\swanted.\s\sThis\sis\son\sNT/SP4.\s\n--\s09/28/1999\shobbs\nFurther\snotes\sfrom\sthe\suser\sindicate\sthat\sthis\sworks\sas\sexpected\nfor\s98\sand\sNT,\sbut\snot\s95.\s\sThis\scould\seither\sbe\sa\sTcl\sor\sMS\nproblem,\sbut\snot\shigh\spriority\sfor\sus\sto\sexamine\sfurther.\s\n--\s09/29/1999\shobbs
J foundin obsolete:\s8.2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title [fconfigure\s$socket\s-error]\sbroken
J type Bug
K 218945ffffffffffffffffffffffffffffffffff
U nobody
Z 7e5eb1a6d9ccb626404c0f38dc837bf3