|
From: Peter M. L. <le...@ho...> - 2001-06-05 13:55:36
|
Hello, I've been having an odd problem since using Icqlib 1.0.0 in my icq client. I've added support for handling Timeouts which works on the following logic: When a icq_SetTimeout event is generated... If the interval is -1, the current Timeout is cleared. If the interval is 0, the current Timeout is cleared. If the interval is larger then 0, the current Timeout is changed to Now() + interval. When the Timeout passes... icq_HandleTimeout is called. And the Timeout is cleared. This seems to work pretty well, and I've not noticed a single dropped message or status change since. However, it produces a slightly weird effect on login. My login sequence is as follows: icq_Init is called to initialize the link. Callbacks are registered with the link. icq_Connect is called to create the UDP connection. icq_Login is called to send the login information to the server. The icq contacts are added to the link. icq_SendContactList is called. icq_SendVisibleList is called. Then the program enters the main loop and starts handling server (and user) response. I believe the icq_Login and/or the contact list calls generate a (15 second) Timeout event. Within those 15 seconds the user is logged in and all the UserOnline events are received. The timeout is not cleared however, and when the 15 seconds are up, HandleTimeout is called. A few seconds after that we get the whole list of UserOnline messages again, as if the contact list packets were resent. I think the Ack messages for the Contact list and Visible List get lost somewhere so icqlib is unable to match them up with the original sent packets. My questions: Is my handling logic of the Timeouts correct? Especially the double-clear case with a zero interval. Why is the contact list not acknowledged properly? Would it help if I moved the sending of the contact and visible lists into the icq_Logged event? (Ie, after the login was properly handled.) Regards, Peter. ---------------------------------------------------------------- Peter M. Lemmen Peter's ICQ Client www.outreach.nl www.outreach.nl/picq pe...@le... pi...@ou... ---------------------------------------------------------------- |