- 论坛徽章:
- 0
|
case AF_UNIX:
srv_socket->addr.un.sun_family = AF_UNIX;
strcpy(srv_socket->addr.un.sun_path, host);
#ifdef SUN_LEN
addr_len = SUN_LEN(&srv_socket->addr.un);
#else
/* stevens says: */
addr_len = strlen(host) + 1 + sizeof(srv_socket->addr.un.sun_family);
#endif
/* check if the socket exists and try to connect to it. */
if (-1 != (fd = connect(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len))) {
close(fd);
log_error_write(srv, __FILE__, __LINE__, "ss",
"server socket is still in use:",
host);
|
lighttpd在创建socket()后,判断系统使用AF_UNIX协议中,设置socket addr完了为什么要connect一下自己呢?而且这个时候还没进行bind。 |
|