Skip to main content

remotePublish syntax question

1 reply [Last post]
henno_b
Offline
Joined: 2010-09-03

I try to use the method DiscoveryService.remotePublish(java.lang.String peerid, Advertisement adv, int type, long lifetime), as explained in the jxta_doc html pages among several possible overloaded versions for this method. However, it does not recognize the version with the lifeTime argument (fourth argument).
If I leave out the lifetime argument it works, but I get a default lifetime of 60 seconds which occassionally leads to misses in reaching the target.
QUESTION: how should I specify the lifeTime for remotePublish to e.g. one hour (= "infinite" for all practical purposes)? Other question: can we somehow check the JXTA version for which certain on-line documentation is related? This is not the first time that I find discrepancies between a "documented" JXTA class and the real (latest) software...

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

> I try to use the method
> DiscoveryService.remotePublish(java.lang.String
> peerid, Advertisement adv, int type, long lifetime),
> as explained in the jxta_doc html pages among several
> possible overloaded versions for this method.
> However, it does not recognize the version with the
> lifeTime argument (fourth argument).
The remotePublish method with 4 arguments is private.

> If I leave out the lifetime argument it works, but I
> get a default lifetime of 60 seconds which
> occassionally leads to misses in reaching the
> target.
> QUESTION: how should I specify the lifeTime for
> remotePublish to e.g. one hour (= "infinite" for all
> practical purposes)?
use the 3 args method remotePublish(String peerid, Advertisement adv, long timeout) with timeout = 1000 * 60 * 60;

> Other question: can we somehow
> check the JXTA version for which certain on-line
> documentation is related? This is not the first time
> that I find discrepancies between a "documented" JXTA
> class and the real (latest) software...
Programmer's guides are 'versioned'. Not really sure I understand your question.