-
-
Save rishid/32e98f4f14d39f21a700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
on_connect_cb(uv_connect_t *request, int status) | |
{ | |
conn_info *ci = (conn_info *)request->data; | |
if (status != 0) | |
{ | |
printf("on connect status error %s %s\n", | |
uv_err_name(status), | |
uv_strerror(status)); | |
struct sockaddr_in addr; | |
uv_ip4_addr("127.0.0.1", 5000, &addr); | |
// client_handle is a uv_tcp_t that was init'ed on first connect | |
uv_tcp_connect(request, &ci->client_handle, (struct sockaddr *)&addr, on_connect_cb); | |
return; | |
} | |
printf("connected status %d\n", status); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment