After sending AniDB a PUSH command, can 271 and 272 packets arrive at any time?
I'm asking because I'm curious why there's also a NOTIFY command alongside PUSH and 27x. I can see that it comes in handy as a keep-alive command every 30 minutes, but if AniDB will send out 27x for every notification concerning a user, why is there a need for NOTIFY and NOTIFYLIST?
Or is it possibly because NOTIFY and NOTIFYLIST are designed to be used separately from of PUSH and 27x packets? Which method is prefered and puts less stress on the server?
271 and 272 packets, notification question
Moderator: AniDB
-
- Posts: 10
- Joined: Sat May 28, 2005 2:50 am
Re: 271 and 272 packets, notification question
As I see it, yes. (It'd be quite useless if a notification couldn't arrive at any time)MistaMuShu wrote:After sending AniDB a PUSH command, can 271 and 272 packets arrive at any time?
AniDB will send a 27x for every notification that's added after the PUSH command has been enabled. It won't send you any info about notifications/messages already pending before the PUSH command was sent. It's for those notifications that NOTIFY/LIST/GET exsist.MistaMuShu wrote:I'm asking because I'm curious why there's also a NOTIFY command alongside PUSH and 27x. I can see that it comes in handy as a keep-alive command every 30 minutes, but if AniDB will send out 27x for every notification concerning a user, why is there a need for NOTIFY and NOTIFYLIST?
The PUSH command should be used if you want to be notified of new notifications, it will require less traffic as it will send you the data when new notifications arrive.MistaMuShu wrote:Or is it possibly because NOTIFY and NOTIFYLIST are designed to be used separately from of PUSH and 27x packets? Which method is prefered and puts less stress on the server?
I've been thinking about writing a client myself and this is how I think it should be used:
Log in (obviously)
Enable notifications (PUSH)
Verify if no notifications/messages have arrived before we enabled the notifications (NOTIFY)
If so get those notifications (NOTIFYLIST/GET)
-
- Posts: 10
- Joined: Sat May 28, 2005 2:50 am
In the client that I'm working on, I have a wrapper object called AniDBConnection that handles the details of sending and decoding commands. All of the commands seem trivial to implement except I'm running into some trouble with 27x responses.
I tag each command I send with the command name and a timestamp. i.e. AUTH_12389531 so that I can verify an incoming response. So now I'm thinking I'll start a separate thread to listen for 27x notifications after I send the PUSH command.
Thanks for the clarification, what you said is mostly how I imagined it, but I just wanted some confirmation.
I tag each command I send with the command name and a timestamp. i.e. AUTH_12389531 so that I can verify an incoming response. So now I'm thinking I'll start a separate thread to listen for 27x notifications after I send the PUSH command.
Thanks for the clarification, what you said is mostly how I imagined it, but I just wanted some confirmation.