[[ Bug 12799 ]] Make sure sockets are processed briefly in wait().
Merge branch 'bugfix-12799' into develop