diff options
-rw-r--r-- | src/afb-ws-client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/afb-ws-client.c b/src/afb-ws-client.c index 2569d135..32f8778e 100644 --- a/src/afb-ws-client.c +++ b/src/afb-ws-client.c @@ -26,6 +26,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> +#include <fcntl.h> #include "afb-wsj1.h" @@ -365,8 +366,10 @@ struct afb_wsj1 *afb_ws_client_connect_wsj1(const char *uri, struct afb_wsj1_itf rc = negociate(fd, proto_json1, path, xhost); if (rc == 0) { result = afb_wsj1_create(fd, itf, closure); - if (result != NULL) + if (result != NULL) { + fcntl(fd, F_SETFL, O_NONBLOCK); break; + } } } close(fd); |