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

Artifact [2ca2c53187]

Artifact 2ca2c53187094576567407943dc400023b53379e81a95eb4f2352a95bb884c5f:

Ticket change [2ca2c53187] - New ticket [d22dc7e9ca3577d8|d22dc7e9ca] <i>socket -async leaves the socket non-blocking when the connect succeeds at once</i>. by serhiy.storchaka on 2026-10-12 08:41:35.
D 2026-10-12T08:41:35.816
J cmimetype text/x-fossil-wiki
J comment On\sillumos\s(OpenIndiana),\sa\snon-blocking\s<code>connect()</code>\sto\sa\slocal\slistener\nsucceeds\sat\sonce\sinstead\sof\sreturning\sEINPROGRESS;\son\sDragonFly\sthis\shappens\sfor\sIPv6\n(<code>::1</code>).\s<code>TcpConnect()</code>\smakes\sthe\ssocket\snon-blocking\sfor\n<code>socket\s-async</code>\sbut\srestores\sthe\sblocking\smode\sonly\swhen\sthe\sconnect\nfinishes\sin\sthe\sbackground.\sSo\safter\ssuch\san\simmediate\sconnect\sthe\ssocket\sstays\nnon-blocking\swhile\sthe\schannel\sis\sblocking,\sand\sa\sblocking\s<code>gets</code>\sreturns\nan\sempty\sstring\sat\sonce.\sThis\sfails\ssocket-14.7.0\sand\s14.7.1\son\sillumos\sand\nsocket-14.7.1\son\sDragonFly.\n\nThis\sis\sa\sregression\sof\s[219061]\s(HP-UX,\sfixed\sin\s8.3.1\sby\sresetting\sthe\ssocket\sto\nblocking\smode\swhen\sthe\sconnect\ssucceeds\sat\sonce).\sSince\sthe\s2011\srework\sthe\nblocking\smode,\scached\ssince\s[3401422],\sis\srestored\sonly\safter\sa\sconnect\sfinishing\sin\nthe\sbackground;\s[3428753]\sfixed\sonly\sthe\sflag\sfor\sconnections\scompleting\sat\sonce.\n\nProposed\sfix\sin\sbranch\s[/timeline?r=unix-async-connect-immediate-success|unix-async-connect-immediate-success].
J foundin 9.1.0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter serhiy.storchaka
J subsystem 27.\sChannel\sTypes
J title socket\s-async\sleaves\sthe\ssocket\snon-blocking\swhen\sthe\sconnect\ssucceeds\sat\sonce
J type Bug
K d22dc7e9ca3577d84c76cf0091d9db9eb9245da2
U serhiy.storchaka
Z 4a69d57011655e1660592ca8ba1982d9