Make implementation multithread
[src/app-framework-binder.git] / src / afb-ws.c
index d159c28..c612610 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 "IoT.bzh"
+ * Copyright (C) 2016, 2017 "IoT.bzh"
  * Author: José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -379,7 +379,7 @@ static void aws_on_readable(struct afb_ws *ws)
        int rc;
 
        assert(ws->ws != NULL);
-       rc = websock_dispatch(ws->ws);
+       rc = websock_dispatch(ws->ws, 0);
        if (rc < 0 && errno == EPIPE)
                afb_ws_hangup(ws);
 }
@@ -407,7 +407,7 @@ static int aws_read(struct afb_ws *ws, size_t size)
                                        return 0;
                                pfd.fd = ws->fd;
                                pfd.events = POLLIN;
-                               poll(&pfd, 1, 10);
+                               poll(&pfd, 1, 10); /* TODO: make fully asynchronous websockets */
                        } else {
                                ws->buffer.size += (size_t)sz;
                                size -= (size_t)sz;