<i>socket-14.11.* write before being notified that the channel is ready</i>.
by
.
D 2024-08-26T16:13:09.493
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment In\sthe\sfollowing\sexcerpt\ssocket.test/socket-14.11.0,\s<code>puts</code>\sis\r\ncalled\sbefore\sany\snotification\sis\sreceived\sthat\sthe\schannel\sis\sready\sfor\r\nwriting:\r\n\r\n<code><verbatim>\r\nset\ssock\s[socket\s-async\slocalhost\s[randport]]\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\r\nfconfigure\s$sock\s-blocking\s0\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\r\nputs\s$sock\sok\r\n</verbatim></code>\r\n\r\nThis\sis\scontraindicated\sin\sthe\sdocumentation:\s"The\sapplication\smust\suse\sthe\sTcl\r\nevent\sloop\sfor\snon-blocking\soutput\sto\swork;\sotherwise\sTcl\snever\sfinds\sout\sthat\r\nthe\sfile\sor\sdevice\sis\sready\sfor\smore\soutput\sdata.\sIt\sis\spossible\sfor\san\r\narbitrarily\slarge\samount\sof\sdata\sto\sbe\sbuffered\sfor\sa\schannel\sin\snon-blocking\r\nmode,\swhich\scould\sconsume\sa\slarge\samount\sof\smemory.\sTo\savoid\swasting\smemory,\r\nnon-blocking\sI/O\sshould\snormally\sbe\sused\sin\san\sevent-driven\sfashion\swith\sthe\r\nchan\sevent\scommand\s(do\snot\sinvoke\schan\sputs\sunless\syou\shave\srecently\sbeen\r\nnotified\svia\sa\sfile\sevent\sthat\sthe\schannel\sis\sready\sfor\smore\soutput\sdata)."\r\n\r\nTherefore,\ssocket-14.11.0\sand\s14.11.1\sare\stesting\sundefined\sbehaviour.
J is_private 0
J login pooryorick
J priority 5\sMedium
J private_contact ace48c675e6d9823c38a3aa91ffddc0ff84cc79f
J resolution None
J severity Important
J status Open
J submitter pooryorick
J subsystem 24.\sChannel\sCommands
J title socket-14.11.*\swrite\sbefore\sbeing\snotified\sthat\sthe\schannel\sis\sready
J type Bug
K 9b67dc961892c8494218ee7eef4b30b08ccef865
U pooryorick
Z 3abed3a313b04171c3bdd881fa1638d6