Although the documentation states plainly that
Session(peername, version, community, port) is the way
to go, I couldn't get it to connect to any other port
than the default 161.
The constructor definitely sets remote_port, which is
then ignored, because it the underlying net-snmp
library discards it and looks for a port in peername
("host:port" format). However, a check in the
constructor effectively combats this, as it calls
gethostbyname() on the passed name, which barfs if it's
written in that form. So, no way to specify a
nondefault port.
The patch attempts to fix this, by removing the
gethostbyname check, changing default port in the
constructor to None, and only setting it when it's
specified. The first change does the trick, the other
one might not matter, because the given port value will
probably be ignored (see above).
Nobody/Anonymous
None
None
Public
| Filename | Description | Download |
|---|---|---|
| otherport.patch | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 146807: otherport.patch | 2005-08-24 14:01 | k3rni |