Skip to content
Tcl Source Code Artifact [e818f439f1]
Login

Artifact [e818f439f1]

Artifact e818f439f1d818a9282ae70ff635997f0b7eac1c:

Ticket change [e818f439f1] - Ticket [2827000fffffffff|2827000fff] <i>tcl incorrectly reports eof to application</i> status still Open with 4 other changes by andreas_kupries on 2009-07-29 01:28:43.
D 2009-07-29T01:28:43
J icomment A\sreview\sof\sthe\sIChan\sclass\sshows\sno\sanomalies.\sUsing\swatch\sto\s(de)activate\sevents\son\sthe\sunderlying\schannel\sis\sa\snice\strick\sfor\savoiding\sflags.\sIt\sshould\swork\sI\swould\sthink.\sAnd\swith\sthat\sthe\simmediate\sforwarding\sof\sevents\sin\sthe\smethods\sreadable/writable\sshould\swork\sas\swell.\n\nI\stried\sto\scompare\sto\smy\srefchan\sexamples,\sbut\sthey\sare\sall\sabout\sbase\schannels\swithout\sa\schannel\sunderneath,\sso\snot\sreally\scomparable.\sThe\snearest\sis\sthe\sfifo2,\ssort\sof,\sas\sit\sconsists\sof\stwo\sref\schannels\stalking\sto\seach,\si.e.\sinternally\sjoined\sat\sthe\ship.\sBut\seven\sthere\sthe\swhole\sbuffer\smgmt\sis\sby\sthe\sfifo\scode,\sthere\sis\sno\sregular\schannel\sinvolved.\n\nAfter\sI\sgot\sme\sthe\sDebug\spackage\sI\scould\srun\sthe\sChan.tcl\sby\sitself,\sdemo\smode.\sThat\sworked.\n\nDo\syou\shave\sa\sdemo\sscript\susing\sChan.tcl\sand\sshowing\sthe\sproblem\s?\nI\shope\shere\sthat\sI\scan\savoid\sgetting\sthe\swhole\swub\ssources.\n\nLooking\sover\sthe\ssave.anno,\smaybe\ssome\smore\sclues\sthere\n\n>\s*\sas\sa\sresult\sof\san\sapp\s[gets],\stcl\swatches\sreads\son\sthe\src:\n>\s\s\schan\s@@{rc18\swatch\ssock15\sread}\n\nHere\smight\sbe\sa\smisunderstanding\sof\sthe\sIO\score.\s'watch'\sis\sprimarily\scalled\sin\sresponse\sto\s'chan\sevent'.\sCalls\sfrom\sthe\sguts\sof\sgets/read\shappen\sfor\stemp.\sdeactivate\sevents,\sand\sre-activate\sthem\swhen\sthe\sTcl\sbuffers\sare\sempty.\sA\scall\sthis\searly\sis\smore\slikely\sfrom\sa\s'chan\sevent'\sthan\s'gets'.\n\n>\s(App\sparses\sthe\sheader\sfrom\ssome\sof\sthe\sreceived\sbytes:\sHttpd\s@@{::Httpd::rc18_1504\n>\sreader\sgot\srequest:\s(...)})\n\nThis\sgets\sevents\son\src18,\sas\sper\sstep\s9.\n\n>\s*\stcl\sreads\sa\sbuffer's\sworth\sof\sbytes\sfrom\src18,\sbut\sthere\sare\sno\sbytes\sbuffered\sin\ssock15,\sso\san\s>\sempty\sstring\sis\sreturned:\n>\s\schan\s@@{rc18\sread\ssock15\s4096\s->\s0\sbytes\s'...'}\n\nYes.\sThis\sis\slike\sin\stestRefchan.tcl,\sstep\s13.\sEvent\sthrough\stimer,\snot\senough\sdata\sin\sthe\sbuffers,\sask\sthe\sOS\sif\sit\shas\smore.\sEmpty\sread.\n\n>\s\s*\stcl\swatches\sread\s(presumably\sbecause\sthe\sapp\shas\sa\sfileevent\sreadable):\n>\schan\s@@{rc18\swatch\ssock15\sread}\n\nLike\sstep\s15.\sInterest\sin\sthe\sbase\sevents\sis\sre-activated.\sThis\salso\sre-activates\ssock15\sevents,\sshould\sbe.\n\n>\s*\sapplication\scalles\s[eof\src18]\swhich\sreturns\strue,\sand\sterminates\sits\sreader:\n>\s\sHttpd\s@@{::Httpd::rc18_1504\sterminate:\s(entity)}\n\nHm.\sHere\sI\swould\shave\sexpected\sfblocked\s...\n\nHm\s...\sIt\sshould\sbe\spossible\sto\smodel\sthat\susing\stestRefchan\s...\sBasically,\sinstead\sof\sgoing\sinto\sstate\s2\swhere\sit\salways\sreturns\sthe\sempty\sstring\sit\sshould\sreturn\snothing\sonce,\sand\sat\sthe\snext\sread\ssomething\s...\sBut\sthe\snext\sread\swill\snot\shappen,\swon't\sit.\sBecause\sof\sthe\s'eof'\sgetting\ssignaled\s...\sOk.\sThat\smeans\sI\sshould\sconcentrate\son\sthe\shappenings\sin\sand\saround\ssteps\s16\sand\s17\sin\src.tcl.\n\n
J login andreas_kupries
J mimetype text/plain
J username andreas_kupries
K 2827000fffffffffffffffffffffffffffffffff
U andreas_kupries
Z 46b65ec1fae154bfa47eeb3cda4badb3