建立 管道通信的时候,使用AF_UNIX提高网络传送速度
if (respawn != NGX_PROCESS_DETACHED) {
/* Solaris 9 still has no AF_LOCAL */
// if (socketpair(AF_UNIX, SOCK_STREAM, 0, ngx_processes[s].channel) == -1) //建立父子进程通信的管道
// {
// ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
// "socketpair() failed while spawning \"%s\"", name);
// return NGX_INVALID_PID;
// }
accept4 设置套接口
//开始accept句柄
#if (NGX_HAVE_ACCEPT4)
if (use_accept4) {
s = accept4(lc->fd, (struct sockaddr *) sa, &socklen,
SOCK_NONBLOCK);
} else {
s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
}
#else
s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
#endif
阅读(1048) | 评论(0) | 转发(0) |