Ommina

Joined 21 September 2007
1,027 bytes added ,  1 April 2008
no edit summary
No edit summary
Line 26: Line 26:
* Use NOTIFY (no more than once every 20 minutes) to get the number of pending notifications
* Use NOTIFY (no more than once every 20 minutes) to get the number of pending notifications
* IF there are new notifications pending, use NOTIFYLIST to get a list of notification types and associated IDs.
* IF there are new notifications pending, use NOTIFYLIST to get a list of notification types and associated IDs.
* Use NOTIFYGET to receive a notification, suppling the ID provided by NOTIFYLIST
* Use NOTIFYACK to acknowledge a notification, suppling the ID provided by NOTIFYLIST (if desired)


Two HOWTOs...
{{eyecatch|NOTE|The ID supplied by NOTIFYLIST will be the ID of the affected notification type. Since, at present, only the anime type is supported, this value is always an aid. In the future, it may represent a group or producer ID. In these cases, the str type value with indicate what entity the ID represents.}}


These commands offer a way to receive different types of notifications:
'''Method Two: Server PUSH'''
 
With this method, the server takes the active role in advising the client that a new file has arrived.  The client must register with the server to receive these advisements, and will be responsible for keeping the login session from timing out, and any NAT router ports open.
 
This method compensates for the disadvantages of the polling method, but is more difficult to code.  Blocking sockets are no longer an option, nor can a client make any assumptions that an incoming packet will necessarily be a reply to the last command sent.  The tag option may be helpful here.
 
A PUSH HOWTO:


'''Simple HOWTO:'''
* PUSH to register your client session.
* PUSH to register your client session.
* Listen for 271-274 NOTIFICATIONs ('''not 290''').
* Listen for 271-274 NOTIFICATIONs ('''not 290''').
* PUSHACK the NOTIFICATIONs received (with the supplied id [nid]).
* Use PUSHACK to to acknowledge the notification using the nid supplied with NOTIFICATION
* Use NOTIFY to get number of notifications / NOTIFYLIST to get a list of the notifications (with ids [not nid]).
* Use NOTIFYGET to receive a notification, suppling the relid provided by NOTIFICATION (NOT the packet ID)
* Use NOTIFYGET to receive a notification.
* Use NOTIFYACK to acknowledge a notification, suppling the relid provided by NOTIFICATION (if desired)
* Use NOTIFYACK to acknowledge a notification (from NOTIFYLIST).
 
It is probably a good idea to use tags to separate NOTIFICATIONs from the other communication. NOTIFICATIONs will '''never''' have tags.
It is probably a good idea to use tags to separate NOTIFICATIONs from the other communication. NOTIFICATIONs will '''never''' have tags.


MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.