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

如果不同的协程使用相同的连接(fd)调用其他服务,那么在收包的时候怎么切换到调用的哪个协程? #47

Open
youzuoyong opened this issue Aug 14, 2017 · 1 comment

Comments

@youzuoyong
Copy link

如题。
协程1 和 协程2使用同一连接(长连接fd)调用其他服务。
收到包时,如何区分切换到协程1还是协程2呢?

@leiffyli
Copy link
Collaborator

@youzuoyong 目前的情况不同协程只能独享fd,否则可能会出现数据乱入的问题。如果真的希望全局共享一个连接,那就只能使用一个收包协程,在收完包之后,依据包内容进行协程分发。

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