Skip to content
Tcl Source Code Artifact [2c3cd3b274]
Login

Artifact [2c3cd3b274]

Artifact 2c3cd3b2748ef0aaf7beacbc6967d01e84017a2ef610e3b2faeb5be47c18ae7d:

Ticket change [2c3cd3b274] - Ticket [de232b49f26da1c1|de232b49f2] <i>write-only nonblocking refchan and Tcl internal buffers</i> status still Open with 3 other changes by apnadkarni on 2024-03-31 14:06:03.
D 2024-03-31T14:06:03.595
J icomment Nathan,\r\n\r\nMost\sof\syour\spost\sfocuses\son\ssomething\sthat\sis\snot\scrux\sof\sthe\suse\scase\sbeing\r\ndiscussed.\s\r\n\r\nThis\sis\snot\sabout\sthe\suse\sof\swritable\sevents\sto\sascertain\swhen\sa\schannel\scan\sbe\r\nwritten\sto.\sIt\sis\sabout\sthe\suse\sof\swritable\sevents\s**to\sasynchronously\sdetect\r\nwhen\sa\sconnection\sis\sopen**.\s\r\n\r\nFrom\sthe\ssocket\s-async\sdocs,\r\n\r\n*Running\sthe\sevent\sloop\salso\sallows\syou\sto\sset\sup\sa\swritable\schannel\sevent\son\sthe\r\nsocket\sto\sget\snotified\swhen\sthe\sasynchronous\sconnection\shas\ssucceeded\sor\sfailed.*\r\n\r\nThe\scomplaint\sI\shave\sis\sthat\sin\s9.0\sthe\swritable\schannel\sevent\sis\sgenerated\r\nprematurely\s-\s**before**\sthe\sconnection\shas\ssucceeded\sor\sfailed.\sWhile\sI\smight\r\nhave\sused\sthe\s"writable\sevent"\sloosely,\sit\sis\sin\sthis\scontext\s-\ssignifying\sthe\r\nconnection\sis\sopen.\r\n\r\nWhile\syou\sairly\sdismiss\stest\sthe\slong\sstanding\ssocket-14.11.0\sas\sa\sbroken\stest,\r\nthis\stest\sis\salmost\sexactly\show\sthe\ssimplest\sof\snetwork\sapplications\s-\sport\r\nscanners\s-\swould\sbe\swritten\s("almost"\sbecause\sa\sport\sscanner\swould\snot\sdo\sthe\r\nputs).\sYour\s"fix"\smakes\sit\simpossible\sto\swrite\sa\sreasonable\s(synchronous\sor\r\npolling\sis\snot\sreasonable)\sone\sin\sTcl.\sI\sdo\snotice\syou\sdid\snot\saddress\sthe\sport\r\nscanner\sexample\sor\sthe\saddress\slogging\sexample\sin\syour\sresponse.\r\n\r\nAnd\sto\sthe\sspecifics\sof\syour\scomments...\r\n\r\n*...twapi\srelated\sexample..*\s-\sno,\syour\scode\sfragment,\sdoes\snot\ssolve\sthe\r\nproblem.\sWhen\sthe\slambda\sfires,\sthe\sconnection\sis\snot\scomplete.\sThe\sfconfigure\r\nand\sfileevent\sfollowing\sare\scompletely\sirrelevant.\sSee\sabove.\sEven\sotherwise,\r\nthe\sidiom\sof\sof\ssocket\s-async\sfollowed\sby\sfconfigure\s-blocking\s0\shas\sbeen\saround\r\nforever.\sThere\shas\sbeen\snothing\sto\sforbid\sit.\sThere\sis\sno\sjustification\sfor\r\nasking\sthat\sto\sbe\sreworked\sas\sa\sworkaround\sfor\sa\sbuggy\score\schange.\r\n\r\n*...Here's\sanother\sexample...*\sabout\sputs\safter\sa\ssocket\s-async.\sAgain,\s\r\nirrelevant.\sputs\sis\snot\sthe\sissue.\sSee\sabove.\r\n\r\n*...socket-14.11.0\sfailures...*\sOh\sif\sonly\swe\scould\sfix\sall\stest\sfailures\sby\r\ndisparaging\sthe\stest!\sThis\sis\sa\sperfectly\sreasonable\stest\sreflecting\sa\sreal\r\nworld\suse\scase.\sI\salso\sdo\snot\sunderstand\syour\spurpose\sbehind\squoting\sthe\smanpage\r\nflushing\s/closing\sthe\schannel.\sThat\sis\scompletely\sirrelevant\sto\sthis\sissue.\r\n\r\n*...I\sbelieve\sthis\sexisting\sfix\sis\stheoretically\scorrect...*\sOutside\sof\ssome\r\nspecial\scases,\sa\stimer\sbased\sevent\sgeneration\sscheme\sfor\sI/O\sis\scompletely\r\npointless.\sIt\sdefeats\sthe\sentire\spurpose\sof\sevent\sbased\sI/O.\sImagine\sthe\sUnix\r\nselect\scall,\swhich\sserves\sa\ssimilar\spurpose,\smarking\sdescriptors\sas\s"ready"\r\nbased\son\sa\stimer\sas\sopposed\sto\sactually\sbeing\sready.\r\n\r\n**Timer\sbased\sevent\sgeneration\sfor\si/o\sis\sessentially\spolling\sat\sregular\r\nintervals.\sThere\sis\sno\spoint\sto\ssuch\san\s"event\sdriven"\si/o\ssystem\swhere\sthe\r\n"event"\sis\sa\stimer\sas\sopposed\sto\si/o!\sAn\sapplication\smight\sas\swell\sjust\spoll\r\nitself\susing\safter!**\r\n\r\n*A\sfew\syears\sago\sI\ssubmitted\sissue\s67a5eabbd3\sand\sfixed\sit*\sRelevance?\sNo\sone\sis\r\ndisputing\srefchan\slimitations\sbut\smy\s-buffering\snone\sbranch\sdoes\snot\sbreak\sthat\r\nissue\seither.\sI\scould\snot\sfind\sa\srelevant\stest\scase\sbut\sI\smanually\stested\sthe\r\nscript\sin\sthat\sissue.\r\n\r\n*I'm\snot\sin\sfavour\sof\schanging\sthe\sdefault\sbuffering\sfor\srefchans.*\sIt\swould\r\nhelp\sif\syou\spointed\sout\sthe\stechnical\sissues\sor\snegative\spractical\simpact\sas\sto\r\nwhy.\sI've\salready\sstated\sin\smy\searlier\spost\sthat\sfixing\srefchans\swould\sbe\r\npreferable\sbut\sI\sdo\snot\sthink\sthat\sis\sfeasible\sin\sa\sreasonable\stime\sframe.\sAn\r\nopinion\sthat\s"it\sis\sa\sknee\sjerk\sreaction"\sis\sneither\shere\sor\sthere.\sYour\r\nreference\sto\sthe\s080f846fd58958ef\sis\sa\sred\sherring\sbecause\syou\sdid\snot\saddress\r\nthe\sactual\sissue\sbeing\sraised\sthere.
J login apnadkarni
J mimetype text/x-markdown
K de232b49f26da1c18e07513d4c7caa203cd27910
U apnadkarni
Z c91f5f2ed214c22157314b251c61724d