|
From: Michael H. <mw...@ca...> - 2001-04-15 11:10:21
|
On Sat, 14 Apr 2001, Ron Poulton wrote: > So I've been attempting to get ICQLIB in my software. Fair warning; I don't really know all that much about iclib (though I did get Python bindings written & got them to work). > It connects, then the hard drive gets accessed wildly. Are you running out of memory (ie. is the hard disk access VM thrashing)? What OS? AFAIK, icqlib doesn't touch the hard drive (except for file transfer stuff, obviously). > I did make a modification, but for contrast purposes, I was originally > coding the ICQ prog to: > > 1) icq_Init > 2) set up callbacks > 3) icq_UnsetProxy > 4) icq_Connect > 5) icq_Login if icq_Connect did not return -1 > 6) continuously call icq_Main in a loop, no delays You don't really want to do that; you want to call icq_Main every 10 ms or so (try usleep or nanosleep). > Suepecting that icq_Main may have been getting overloaded, I modified the > above structure such that: > > 6) alarm(SIGALRM,bkgfuncs) > 7) alarm(1) > 8) the main loop would just check for a "Q" from the keyboard > > The bkgfuncs, called once per second in theory, would call icq_Main and, > after icq_Main was finished, rearm the system for a 1 second delay until > the next call. > > Now, the hard drive is still being accessed (it takes longer for it to > become violent). Could your callbacks be leaking memory? That's about all I can think of. > Is there something I'm missing in all of this? Do I need to reference > ALL callbacks, or is there a core set I need for just basic messaging > and user databasing? No, I think you can just implement the one's you're interested in; icqlib checks for NULLs before calling the callbacks. HTH, but it might be better if someone with more iclib knowledge/intuition spoke up... Cheers, M. |