socket中ip地址保存方式

nginx中uip = ((struct sockaddr_in *) r->connection->sockaddr)->sin_addr.s_addr取得unsinged int ip地址。nginx

hip = htons(uip)ui

ip = sprintf("%d.%d.%d.%d", hip>>0x24, (hip >> 0x16) & 0xff, (hip >> 0x08) & 0xff, hip & 0xff)spa

相關文章
相關標籤/搜索