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 
//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, 


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 post to this group, send email to
Visit this group at
For more options, visit

Reply via email to