There are some situations where the program may still block, if it is not programmed very carefully.
Despite the open system call, the connect system call may also block. To avoid blocking, you must first set the socket to non-blocking mode. E.g.
let s = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in Unix.set_nonblock s; Unix.connect s some_address;
Other blocking candidates are the name-server functions, in O'Caml Unix.inet_addr_of_string. This is very hard to solve because the underlying C library performs the DNS lookup. The POSIX thread implemention does not help, because special DNS functions needs to be called to avoid blocking (these functions have a reentrant function interface), and the O'Caml Unix module does not use them. A possible solution is to fork a new process, and let the new process perform the DNS lookup.