Menu

Timeouts

Draky Void
2001-07-19
2001-07-25
  • Draky Void

    Draky Void - 2001-07-19

    I've got  a trouble understanding how to do correct timeouts handling with icqlib.  Does anyone knows how to do it?
    I'm using the current icqlib version (got it from cvs). Btw, is the project stalled or what? :) I see no updates in cvs for almost 5 weeks...

     
    • ramachandran

      ramachandran - 2001-07-19

      put this somewhere after all the callsbacks are made in the Main()..
      -----------------------------------------

      void Test_ClientAlive(icq_link *pIcqlnkStruct)
      {
        struct timeval PreviousTimeValue;
        struct timeval CurrentTimeValue;
        gettimeofday(&PreviousTimeValue,NULL);
        while(1)
        {
          usleep(1000000); //to prevent cpu hogging!!
          icq_Main(pIcqlnkStruct);
          gettimeofday(&CurrentTimeValue,NULL);
          if(CurrentTimeValue.tv_sec - PreviousTimeValue.tv_sec > 120)
          {
            icq_KeepAlive(pIcqlnkStruct );
            printf("sent keepalive packet-- sending again after 120 seconds \n");
            memcpy(&PreviousTimeValue,&CurrentTimeValue,sizeof(struct timeval));
          }
        }
       
      }

       
      • Draky Void

        Draky Void - 2001-07-20

        Uhm... thanks anyway... but it isn't the thing I asked about. I meant icq_SetTimeout callback and icq_HandleTimeout funcion. What should I do with them?

         
    • ramachandran

      ramachandran - 2001-07-20

      This link has all the details on how to use it..

      http://www.geocrawler.com/lists/3/SourceForge/884/0/5714003/

       
    • Draky Void

      Draky Void - 2001-07-25

      Thank you very much. That link explained me all I wanted to know.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.