Skip to main content

How to see if a peer signed out of the network?

2 replies [Last post]
ariel_ro
Offline
Joined: 2009-12-28
Points: 0

I want to accomplish a simple functionality here. I want to see in real-time what the peers connected to the network(LAN) are.

I find no API method to catch the event when a peer signed out. Currently I'm sending peer advs at a regular interval and that's all my discovery protocol. It would be much more nice to be able to receive 2 events: when a user got in and got out of the network.

How would any of you implement this task?(I'm aware of Peer Information Protocol but don't know how to use it)

Any help will be highly apreciated!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
adamman71
Offline
Joined: 2007-01-31
Points: 0

PIP won't help you on that one (dead end/dead approach).

Sending advertisements has the inherent problem of expiration.

Solution I: create a jxtamulticastsocket where logging/logout events are propagated (each peer should register to it)

Solution II: create a query system if you want to control who gets the message.

Think about the new isReachable() method in the endpoint service too for weird situations where peers disappeared without notification.

ariel_ro
Offline
Joined: 2009-12-28
Points: 0

Solution 1 seems quite handy.
Thanks!