Is there a way to use a client socket in a non blocking way.
For example, if I create a socket for a client to connect on a server and that I do recursive recv on that socket, the last call of Unix.recv will block when no data is send and if the connection is not closed by the server.
In C, you can specify flags for both :
socket()and use theSOCK_NONBLOCKflag ORed with the socket type- or
receiv()with theMSG_DONTWAITflags.
I have looked here :
- http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEsocket_bool_option
- http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEsocket_type
- http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEmsg_flag
- https://ocaml.github.io/ocamlunix/ocamlunix.html#sec119
But I could not find any informations on this.