+static int cont_connect(COMSTACK h)
+{
+#if HAVE_GETADDRINFO
+ tcpip_state *sp = (tcpip_state *)h->cprivate;
+ struct addrinfo *ai = sp->ai_this;
+ while (ai && (ai = ai->ai_next))
+ {
+ int s;
+ s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ if (s != -1)
+ {
+#ifdef WIN32
+ closesocket(h->iofile);
+#else
+ close(h->iofile);
+#endif
+ fprintf(stderr, "Other socket call fd=%d\n", s);
+ h->state = CS_ST_UNBND;
+ h->iofile = s;
+ sp->ai_this = ai;
+ tcpip_set_blocking(h, h->flags);
+ return tcpip_connect(h, ai);
+ }
+#endif
+ }
+ h->cerrno = CSYSERR;
+ return -1;
+}
+
+