Presence service
[email protected] Tue, 05 Dec 2006 11:37:15 +0100
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
I implemented a presence service for my application a few weeks ago but it is much too slow and unreliable and I want to implement it different this time and would like to hear your comments. My current implementation is based on advertisements that are published every 5 minutes using a timer task such as Brendon J. Wilson is doing it in his book. Other peers are searching for these advertisments with a timer task. So the problem with this is that it can take up to a few minutes until a peer is found to be online and a peer could go offline and it is not recognized. So I definitely need to change this. My new approach would be a mix of advertisments and a propagate pipe. The advertisment is published to the peer group with an application specific description of the peer. This advertisment for example holds a pipeadvertisment for a JxtaSocket which is later used to transfer files. When a peer enters my peer group it searches for the advertisments of other peers so that they can be displayed in the GUI as offline. It also sends a "hello" message to all other peers in the peer group with its status such as "online" and gets a response from all other devices that are online too. Do you have any other ideas on implementing a presence service? How did other applications solve this? thanks in advance, Vince