On 22 June 2010 01:33, s00110979 <[email protected]> wrote:
> I have a question about codes in file snmp_api.c
> int
> snmp_sess_select_info(void *sessp,
> int *numfds,
> fd_set * fdset, struct timeval *timeout, int *block)
Note that this API uses the standard 'fd_set' data structure,
so is limited by the restriction of this structure.
i.e. a maximum of FD_SETSIZE
> netsnmp_large_fd_set lfdset;
This is a Net-SNMP specific structure, designed to handle
larger collections.
> rc = snmp_sess_select_info2(sessp, numfds, &lfdset, timeout, block);
This is the API designed to work with such larger collections.
> after call snmp_sess_select_info2 , all infomation is in
> lfdset, Next they call netsnmp_copy_large_fd_set_to_fd_set?
Yes - because this is the compatibility API, working with the
traditional 'fdset' structure.
> function netsnmp_copy_large_fd_set_to_fd_set always returns -1
> in large file descriptor.
Yes - it will. Since 'fdset' cannot handle such large collections.
That's why we needed to introduce the large version.
> Is there a bug?
No.
If you use a compatibility routine, then you will inevitably be
limited by the restrictions of that environment. If you wish
to make use of the wider capabilities of the large_fd_set
handling, then you should call the large_fd_set APIs directly.
Which is exactly what the error message says:
> if (netsnmp_copy_large_fd_set_to_fd_set(fdset, &lfdset) < 0) {
> snmp_log(LOG_ERR,
> "Use snmp_sess_select_info2() for processing"
> " large file descriptors");
> }
Dave
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders