Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当设置 dispatch_mode = 2 时,onConnect, onClose 事件与 onReceive 事件不在一个工作进程中。详见截图! #48

Closed
designinlife opened this issue Mar 26, 2014 · 4 comments

Comments

@designinlife
Copy link

当设置 dispatch_mode = 2 时,onConnect, onClose 事件与 onReceive 事件不在一个工作进程中。详见截图!

2014-03-27_063541

@matyhtf
Copy link
Member

matyhtf commented Mar 27, 2014

哪个版本?

@designinlife
Copy link
Author

swoole-1.6.11-stable

@matyhtf
Copy link
Member

matyhtf commented Mar 27, 2014

Ok. 刚才已经找到问题的原因,已修复。

@matyhtf
Copy link
Member

matyhtf commented Apr 10, 2014

1.6.11版本的用户,请手工修改代码,将src/factory/FactoryProcess.c修改的swFactoryProcess_send2worker函数中。

//使用fd取摸来散列
        else if (serv->dispatch_mode == SW_DISPATCH_FDMOD)
        {
            if(data->info.type == SW_EVENT_TCP)
            {
                pti = data->info.fd % object->worker_num;
            }
            //udp use remote port
            else
            {
                pti = ((uint16_t) data->info.from_id) % object->worker_num;
            }
        }

修改为

//使用fd取摸来散列
        else if (serv->dispatch_mode == SW_DISPATCH_FDMOD)
        {
            //udp use remote port
            if (data->info.type == SW_EVENT_UDP)
            {
                pti = ((uint16_t) data->info.from_id) % object->worker_num;
            }
            else
            {
                pti = data->info.fd % object->worker_num;
            }
        }

然后重新编译,安装。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants