Skip to content

What will be status value in connect_cb of uv_tcp_connect(&connect_req, &h, addr, connect_cb)? #4354

Discussion options

You must be logged in to vote

How to handle the uv_tcp_connect() when uv_getaddrinfo() returns multiple addrinfo sturcture?

You call uv_tcp_connect() for each record.

does that mean the status will be zero always?

If the TCP handshake succeeded, otherwise it's an error code.

Should we call uv_close(req->handle) before recursively calling ?

Yes, you should close the uv_tcp_t handle on error. It's possible for an error to be temporary and the uv_tcp_t to be in a reusable state, but it's easier to simply create a new one.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by parthasarathi204
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants