.
D 2007-07-07T12:39:41
J assignee andreas_kupries
J cmimetype text/plain
J comment When\sa\ssocket\sis\sconfigured\snon-blocking,\schan\spending\sis\snot\supdated\sif\s[gets]\sis\snot\scalled.\nFor\sexample\sthe\sfollowing\sscript,\swill:\n\n1)\sAlways\sputs\s0\sto\sstdout\n2)\sFire\sthe\sevent\shandler\svery\srapidly.\n\n#\s-----\nsocket\s-server\stest\s80\n\nproc\stest\s{sock\sargs}\s{\n\s\s\sfileevent\s$sock\sreadable\s\s[list\spending\s$sock]\n\s\s\sfconfigure\s$sock\s-blocking\s0\n}\n\nproc\spending\s{sock}\s{\n\s\s\sputs\s[chan\spending\sinput\s$sock]\n}\n\nvwait\sforever\n#\s-----\n\nIf\sa\s[gets\s$sock]\sis\sadded\sin\sthe\spending\sproc,\sthe\schan\spending\sresult\swill\sbe\scorrect\sand\sthe\sreadable\sevent\swill\snot\scontinue\sto\sfire.\n\nThis\swill\slimit\sthe\susefulness\sof\schan\spending\sin\scases\swhere\sthe\sread\sdata\sis\snot\sline\sbased\s(and\sthus\sgets\sis\snot\sa\sgood\sfit)\n\nFurthermore,\sthe\sbehaviour\sis\snot\sconsistent\swith\sthe\smanual\spage\swhich\sstates:\n\nreturns\sthe\snumber\sof\sbytes\sof\sinput\sor\soutput\s(respectively)\scurrently\sbuffered\sinternally\sfor\schannelId\n\nNowhere\sdoes\sit\sstate\sthat\schan\spending\swill\sonly\sbe\supdated\safter\sa\sunsuccesful\sinput\soperation\s(which\scan\sonly\sbe\sachieved\sby\s[gets],\sbecause\sread\salways\sreturns\ssome\sdata\s(in\sthe\sunblocking\scase)).\s\n\nAdditional\sinfo:\n\n>\stclsh\n%\sparray\stcl_platform\ntcl_platform(byteOrder)\s\s\s=\slittleEndian\ntcl_platform(machine)\s\s\s\s\s=\sintel\ntcl_platform(os)\s\s\s\s\s\s\s\s\s\s=\sWindows\sNT\ntcl_platform(osVersion)\s\s\s=\s5.1\ntcl_platform(platform)\s\s\s\s=\swindows\ntcl_platform(pointerSize)\s=\s4\ntcl_platform(user)\s\s\s\s\s\s\s\s=\smjanssen\ntcl_platform(wordSize)\s\s\s\s=\s4\n%\sinfo\spatch\n8.5a7\n\s
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter mpc_janssen
J subsystem 24.\sChannel\sCommands
J title chan\spending\snot\supdated\swithout\sa\sgets
J type Bug
K 1749581fffffffffffffffffffffffffffffffff
U mpc_janssen
Z 726145b66f1235e7118063f8c265d15b