.
D 2006-09-10T09:04:01
J assignee andreas_kupries
J cmimetype text/plain
J comment I\swas\sgetting\sweird\serrors\swhile\sexperimenting\swith\sPats\s\ndns\spackage\susing\sthe\s\scode\sbelow.\sWhat\sit\sdoes\sis\s\nessentially\sopen\sa\stcp\ssocket\sasync\sto\sthe\sdns\sport\s(53),\s\ngets\ssome\sstuff,\sand\sinvokes\sa\scallback\swhile\sits\ssocket\sis\s\nstill\sopen.\sIn\sthe\scallback\sI\sopen\sanother\ssocket\sasync\sbut\s\nthe\swritable\shandler\sis\snever\sinvoked\sif\sI\sdo\sdns::cleanup\son\s\nthe\sdns\stoken\s(which\scloses\ssocket).\s\nIt\sturned\sout\sthat\sthe\ssecond\ssocket\screated\sis\sidentical\sto\s\nthe\salready\sopen\sone!!!\s\nThe\sdebug\soutput\slooks\sessentially:\s\n\n--->\scb\s::dns::1\s\n...\s\n::dns::1(sock)\s\s\s\s\s\s\s\s=\ssock12\s\n...\s\n\s\s\s\s\s\s\s\ssocket=sock12\s\n\nTwo\sdifferent\sopen\ssockets\swith\sidentical\snames!!!\s\nThis\shappens\sconsistently\son\sMacOS\s10.2.8\sTcl\s8.4.9\s\n(sorry\sfor\snot\shaving\sa\smore\srecent\sone).\s\nI\shave\stested\sWinXP\susing\s8.4.12\s(I\sguess)\sand\sit\shappened\sonce,\s\nand\sthen\sI\scouldn't\sreproduce\sit\sanymore.\s\n\nIdeas?\s\s\s\sMats\s\n\npackage\srequire\sdns\s\nproc\scb\s{token}\s{\s\n\s\s\sglobal\ss\s\n\s\s\sputs\s"--->\scb\s$token"\s\n\s\s\sparray\s$token\s\n\s\s\sset\ss\s[socket\s-async\sgoogle.com\s80]\s\n\s\s\sfconfigure\s$s\s-blocking\s0\s\n\s\s\sfileevent\s$s\swritable\swritable\s\n\s\s\sputs\s"\\t\ssocket=$s"\s\n\s\s\s#\sTry\swith\sand\swithout\scleanup.\s\n\s\s\sdns::cleanup\s$token\s\n}\n\nproc\swritable\s{args}\s{\s\n\s\s\sglobal\ss\s\n\s\s\sputs\s"+++>\swritable\ss=$s"\s\n\s\s\sclose\s$s\s\n}\n\ndns::resolve\sgoogle.com\s-command\scb\s-protocol\stcp\s\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter matben
J subsystem 24.\sChannel\sCommands
J title socket\sname\scorruption
J type Bug
K 1555698fffffffffffffffffffffffffffffffff
U matben
Z d37f0b617c3df1e215eee64611680007