/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2009 Index Data
* See the file LICENSE for details.
*/
/**
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
-#include <yaz/nmem.h>
+#include <yaz/errno.h>
static int tcpip_close(COMSTACK h);
static int tcpip_put(COMSTACK h, char *buf, int size);
return 1;
}
-
#if HAVE_GETADDRINFO
void *tcpip_straddr(COMSTACK h, const char *str)
{
{
s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (s != -1)
+ {
+ sp->ai = ai;
break;
+ }
}
if (s == -1)
return 0;
h->cerrno = CSOUTSTATE;
return -1;
}
+#ifdef WIN32
+ h->newfd = accept(h->iofile, 0, 0);
+#else
h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len);
+#endif
if (h->newfd < 0)
{
if (
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab