It looks like if I specify a broadcast IP (255.255.255.255), the library doesn't send any data and just throws an exception saying maximum number of retries exceeded.
Should this library support UDP broadcast? Maybe there is an API call I am missing?
I just looked at the source and it seems you don't set the Broadcast flag on the socket. This causes the socket to throw an exception.
You don't handle this specific exception, so you report it as a timeout error. You should probably include a way for the user to pass in their own socket options, or maybe just enable broadcasting all the time.
Broadcast being one to many request, features like timeout and retry would be meaningless, also, SNMPv3 support would be very difficult to implement. For these reasons broadcast request handling (as well as multicast) is not planned for UdpTarget class.
This doesn't mean you can't implement this functionality on your own. The packet classes allow you to encode/decode packets and all you have to do is focus on coding the network component and logic of handling reply packets from different agents.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.