X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fsac-a-push.phh;h=fdbb9686fadcbb516f4d68105cb76b1a42baa601;hb=b07b702ce4c2f769d4bb948d9f95f660c21baf73;hp=c187d91aa63b7e8d579983781bec8b8bdf9330fe;hpb=0b6452e28c5b16fbbde6191a6db4293905b808e3;p=brisk.git diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index c187d91..fdbb968 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -485,7 +485,7 @@ class Sac_a_push { $thiz->file_socket_pfx = $sockname_pfx; $thiz->unix_socket_pfx = "unix://$sockname_pfx"; - $thiz->direct_socket = "unix://${sockname}_admin.sock"; + $thiz->direct_socket = "unix://${sockname_pfx}_admin.sock"; $thiz->debug = $debug; $thiz->list_web = array(); $thiz->socks = array(); @@ -706,7 +706,9 @@ class Sac_a_push { $lastime = 0; $dump_users = TRUE; + $sock_shard_cur = -1; while ($this->main_loop) { + $sock_shard_cur = ($sock_shard_cur + 1) % SOCK_SHARD_N; $this->app->sess_cur_set(FALSE); $this->curtime = time(); if ($lastime != ($this->curtime >> 2)) { @@ -828,7 +830,7 @@ class Sac_a_push { stream_set_blocking($new_unix, $this->blocking_mode); $this->direct_mgmt($new_unix); } // not socket_list nor socket_list_cmd - else { // already opened socket + else if ($id % SOCK_SHARD_N == $sock_shard_cur) { // already opened socket $buf = fread($sock, 4096); // if socket is closed if ($buf == FALSE || feof($sock)) {