under the terms of the license (GNU LGPL) which comes with this package. */
#include <errno.h>
+#include <sys/time.h> /* struct timeval */
#include <sys/types.h>
#include <sys/socket.h>
-#include "Transport/transport_private.h"
+#include "gras/Transport/transport_private.h"
GRAS_LOG_EXTERNAL_CATEGORY(transport);
GRAS_LOG_DEFAULT_CATEGORY(transport);
gras_error_t errcode;
gras_dynar_t *sockets= gras_socketset_get();
int done = -1;
- double wakeup = gras_time() + 1000000*timeout;
+ double wakeup = gras_os_time() + 1000000*timeout;
double now = 0;
/* nextToService used to make sure socket with high number do not starve */
- // static int nextToService = 0;
+ /* static int nextToService = 0; */
struct timeval tout, *p_tout;
int max_fds=0; /* first arg of select: number of existing sockets */
*dst=NULL;
while (done == -1) {
if (timeout > 0) { /* did we timeout already? */
- now = gras_time();
+ now = gras_os_time();
if (now == -1 || now >= wakeup) {
done = 0; /* didn't find anything */
break;
RAISE3(system_error,"invalid select: nb fds: %d, timeout: %d.%d",
max_fds, (int)tout.tv_sec,(int) tout.tv_usec);
case ENOMEM:
- RAISE_MALLOC;
+ gras_assert0(0,"Malloc error during the select");
default:
RAISE2(system_error,"Error during select: %s (%d)",
strerror(errno),errno);
TRY(sock_iter->plugin->socket_accept(sock_iter,&accepted));
accepted->raw = sock_iter->raw;
- TRY(gras_dynar_push(sockets,&accepted));
} else {
#if 0
FIXME: this fails of files. quite logical