how to check if client is connected using ipv4 or ipv6 in libuv?
I have this code,

struct sockaddr_storage cp;
int ilen=sizeof(cp);
uv_tcp_getpeername((uv_tcp_t*)client, (struct sockaddr*)&cp,&ilen);
int ret=uv_ip6_name((const struct 
sockaddr_in6*)&cp,(char*)ipname,sizeof(ipname));
//I don't think this is correct, but I haven't any clues
if (retip<0 || std::string("::")==ipname)
{
  retip=uv_ip4_name((const struct sockaddr_in*)&cp,(char*)ipname, 
sizeof(ipname));

}

any corrections ? thanks

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to libuv+unsubscr...@googlegroups.com.
To post to this group, send email to libuv@googlegroups.com.
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to