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

[question] why use count field in loop not len(fdconns)? #75

Open
Ccheers opened this issue Jun 11, 2022 · 0 comments
Open

[question] why use count field in loop not len(fdconns)? #75

Ccheers opened this issue Jun 11, 2022 · 0 comments

Comments

@Ccheers
Copy link

Ccheers commented Jun 11, 2022

type loop struct {
	idx     int            // loop index in the server loops list
	poll    *internal.Poll // epoll or kqueue
	packet  []byte         // read packet buffer
	fdconns map[int]*conn  // loop connections fd -> conn
	count   int32          // connection count
}

why not use len(fdconns) instead of count?

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

1 participant