What will be status value in connect_cb of uv_tcp_connect(&connect_req, &h, addr, connect_cb)? #4354
-
Hi, connect_cb(uv_connect_t *req, int status){ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You call uv_tcp_connect() for each record.
If the TCP handshake succeeded, otherwise it's an error code.
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. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I have two more question related to this. The binary structure is something like 2. The same binary structure did not work in case of Macos a.out Surely, moving to same version libuv and linking dynamically is best but that is not possible for now. That is the reason we started linking statically so that multiple version libuv can be used. 2.out is working as expected for windows and linux, but not working for macos. Any suggestion? |
Beta Was this translation helpful? Give feedback.
You call uv_tcp_connect() for each record.
If the TCP handshake succeeded, otherwise it's an error code.
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.