1cf30f57e1
waiting for the socket to connect and use msleep() on the socket mute rather than tsleep(). Acquire socket buffer mutexes around read-modify-write of socket buffer flags.