vendredi 22 juillet 2016

libuv: what's the int returned by uv_tcp_connect?

Consider the documentation of uv_tcp_connect.
Here is the declaration of the function:

int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle, const struct sockaddr* addr, uv_connect_cb cb);

It accepts a callback and returns an integer.
Usually, the other functions in libuv returns an error code (0 in case of no errors).
I guess also this one works the same way.

What is unclear to me (and undocumented as well) is: in case of a return value not equal to 0, will the callback be invoked anyway?
In other terms, does a return value different from 0 mean that the operation won't be performed at all or it is guaranteed that the callback is invoked?

Unfortunately, it seems that it is not documented what the return value actually is.

Aucun commentaire:

Enregistrer un commentaire