Commit 0153ac42 authored by Mikhail Zabaluev's avatar Mikhail Zabaluev

Set the socket to non-blocking mode before calling connect()

darcs-hash:20070507113036-5b6ca-b8d0fe36f0c3b716ff2885ea3810b16851ef758a.gz
parent c3c648b9
......@@ -964,6 +964,10 @@ tport_t *tport_base_connect(tport_primary_t *pri,
if (tport_setname(self, tpn->tpn_proto, real_ai, tpn->tpn_canon) == -1)
TPORT_CONNECT_ERROR(su_errno(), tport_setname);
/* Try to have a non-blocking connect().
* The su_wait_create() below makes the socket non-blocking anyway. */
su_setblocking(s, 0);
if (connect(s, ai->ai_addr, (socklen_t)(ai->ai_addrlen)) == SOCKET_ERROR) {
err = su_errno();
if (!su_is_blocking(err))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment