[Fwd: Re: Dynany]



meant to bounce to list aswell...

Michael Meeks wrote:
> 
>>What's the correct way to create and use DynAny's?
> 
> 	Prolly to avoid it ;-) it's an over-engineered mess IMHO.

Heh - I got round the problem by directly using RFC1157_SNMP.idl instead
which includes all of the relevant type defines, but I figured out the
DynamicAny's in the end anyway, and that way lies a horrible nasty mess :p

Just another quick one. Any recommendations on how to add my own
socket's to the select() loop? Again, I can only find old docs.
I'm currently doing this:

--
     udp = getprotobyname("udp");
     s = socket(PF_INET, SOCK_DGRAM, udp->p_proto);
     if (s < 0)
     {
         printf("Failed to grab socket.\n");
         return;
     }


     sa.sin_family=AF_INET;
     sa.sin_addr.s_addr = htonl(INADDR_ANY);
     sa.sin_port = htons(162);


     if (bind(s, (struct sockaddr *)&sa, sizeof(sa)) < 0)
     {
         printf("Can't bind local SNMP socket!\n");
         return;
     }
     channel = g_io_channel_unix_new(s);
     g_io_channel_set_flags(channel, g_io_channel_get_flags(channel) |
G_IO_FLAG_NONBLOCK, NULL);
     g_io_channel_set_encoding(channel, NULL, NULL);
     g_io_add_watch(channel, G_IO_IN | G_IO_HUP,
impl_RMP_SNMPTrapd_eventfunc, NULL);
--

But impl_RMP_SNMPTrapd_eventfunc never seems to get called when data
arrives at the socket, even though I can see the data arriving with
TCPDump, and I can see the socket listening in a netstat -a.

I saw some mentions of IIOPAddConnectionHandler or something, but that
looks to be old now there's a glib main loop, but then I can't suss why
the glib functions don't work right ;) Do I need to hook linc?

Thanks for all your help, sorry about the question overload ;)

Cheers,
Chris.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]