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

Rft: separate udp/tcp/ws code logic #24

Open
wongoo opened this issue Sep 6, 2019 · 2 comments
Open

Rft: separate udp/tcp/ws code logic #24

wongoo opened this issue Sep 6, 2019 · 2 comments

Comments

@wongoo
Copy link

wongoo commented Sep 6, 2019

there are lot of code that need to consider what kind of the connection, tcp or udp or ws, which let the code logic complex.

So suggest to separate udp/tcp/ws code logic.

For example, a interface can be defined:

type ProtocolHandler interface {
     handleLoop()
     handlePackage()
}

Assign matched ProtocolHandler to a protocol, not check the type of connection in handler logic, make the logic simple.

@AlexStocks
Copy link
Owner

A good suggestion. I will do it in some days later.

fangyincheng pushed a commit to fangyincheng/getty that referenced this issue Sep 6, 2019
Fix: cpu 100% in session.handleLoop
@AlexStocks
Copy link
Owner

@wongoo would u try to do it? because i am so familiar with getty that i have no idea how to split them.

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

No branches or pull requests

2 participants