-
Notifications
You must be signed in to change notification settings - Fork 47
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
Trap receiver #4
Conversation
This change adds trap server which is responsible for receiving of trap events. When server receives trap package it will be decoded and dispatched to concrete listener using separate goroutine. Fixes #3
@mgenov I would like to get your feedback. |
} | ||
}() | ||
|
||
l := s.Listener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listener shouldn't be checked for each connection I suppose. Moving one level up will remove the number of checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listener can be changed at any time, because it is public member.
Fixed ed35def
Overall: I think that things are looking really good. +2 about this change. The only think that bothers me is that there are several places where packet versioning is checked. For example, when TrapServer is initialised, it has mp: newMessageProcessing(V2c), // server explicitly says that it uses messages V2c but latter in the handle func there is: if v := msg.Version(); v == V2c {
} so even server has decided what message processing to be used, it makes another versioning check. |
That's true. These is temporarily implementation. When support the other SNMP version, there is a need to be modified. |
LGTM ! |
resolve #2
For the following reasons, I changed some API from #2