Skip to main content

peer is no more

14 replies [Last post]
somkumar155
Offline
Joined: 2007-11-16
Points: 0

How can i know , now peer is offline,
whenever ny peer gets offline due to any reason how can i find out on other peers
plzzzzzzzzzzzzzzzzzzzzzz its really urgent

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
somkumar155
Offline
Joined: 2007-11-16
Points: 0

plzzzzz give me the exact metod so cld use it

hamada
Offline
Joined: 2003-06-12
Points: 0
somkumar155
Offline
Joined: 2007-11-16
Points: 0

but the problem is how can i use in my application bcoz when i m using with discovery service then this gives false too where peer is available , i think this is bcoz its creates socket connection with same client very rapidy

hamada
Offline
Joined: 2003-06-12
Points: 0

you probably overlooked importing the right classes. look at project shoal's MasterNode as it utilize this exact functionality.

somkumar155
Offline
Joined: 2007-11-16
Points: 0

can i use endpoint address ping () method has the effect of putting into
motion the sending of query messages in order to find a route between the
requesting peer and the remote peer.
if it gives true then it means peer is still alive plz guide me m i ri8 r wrong................?

hamada
Offline
Joined: 2003-06-12
Points: 0

The method I described is the most reliable way, you should follow it.

somkumar155
Offline
Joined: 2007-11-16
Points: 0

dear problem with this is
endpointRouter = (group.getEndpointService()).getMessageTransport("jxta");

boolean isConnected = endpointRouter.transportControl(EndpointRouter.GET_ROUTE_CONTROL, null).isConnected(pid, routeAdv);

it gives compilation error no such method exist- isConnected(pid, routeAdv)

hamada
Offline
Joined: 2003-06-12
Points: 0

You check to see if a connection exist to a node, or one can be established using the following tid bit

endpointRouter = (group.getEndpointService()).getMessageTransport("jxta");

boolean isConnected = endpointRouter.transportControl(EndpointRouter.GET_ROUTE_CONTROL, null).isConnected(pid, routeAdv);

routeAdv can be null.

somkumar155
Offline
Joined: 2007-11-16
Points: 0

hi n thanks but it giving compile time error -cannot find isConnected(--,--)
n i hd chked nd there is no such method is there
so plzzzzz guide me 1ce again........

moxi_m
Offline
Joined: 2007-02-01
Points: 0

I suggest start taking classes in English grammar and brushing up on your vocabulary - and manners.

You will get more helpful responses if more people understand what you are saying as not everyone is into l33t speak.

somkumar155
Offline
Joined: 2007-11-16
Points: 0

thnx buddy ......
but this is nt the ans of my quest.
i simply asked how can i get the offline status of peers when they are not available due to reason like net problem r due to sm sys problem ......

adamman71
Offline
Joined: 2007-01-31
Points: 0

Check the Peer Info Protocol. You can request a status report for remote peers and a listener. If the report is not returned on time, your listener will be called with a specific method notifying that no reports could be obtained. The cause can be retrieved from the event.

J.

somkumar155
Offline
Joined: 2007-11-16
Points: 0

thanks buddy but its nt good the idea , if we couldnt find the response in time then it will nt wrk , plz give me ny other sol. if u hv
i m so thankul.......

adamman71
Offline
Joined: 2007-01-31
Points: 0

"Buddy", how do you know that your cat is not dead when it has gone for a walk? You know about this, because it comes back to you. If it does not, you cannot draw a conclusion until you find your cat dead or you find it has decided to stay at another location or you find another explanation for its long absence.

If you don't get a report from the probed peer, you can assume that it cannot be reached by your peer, but nothing more. There is no way to be 100% sure that a peer has been disconnected. This problem is not related to JXTA, it is general problem in network communication. Sometimes, you will need to make the assumption that if you peer cannot be reached, it is disconnected, although there might be another explanation.

Another way to find out whether you can reach a peer is to take a look at the code in the deprecate ping method of the endpoint service. It will give you an idea of how to proceed. You will need to do a bit of research by yourself !!!

J.