dev@glassfish.java.net

Re: About NonBlockingWireOutputPipe's TTL Setting

From: Justin Wyer <justin_at_lifeasageek.com>
Date: Tue, 11 May 2010 10:41:50 +0200

Some additional clarity.

2010/5/11 Wu Jie <wujie_at_cn.fujitsu.com>:
> Hello JXTA Dev Team
> Hello GF Shoal Dev Team
>
> Sorry for interrupting you.
>
> I come from Fujitsu China and have sth doubt about TTL(time to live) setting
> in JXTA's implementation(JXSE).
>
> [Problem]
> jxse-src-2.5\impl\src\net\jxta\impl\pipe\NonBlockingWireOutputPipe.java
> ------------------------------------------------------------
> public boolean send(Message message) throws IOException {
>       ... ...
>       WireHeader header = new WireHeader();
>       header.setPipeID(getPipeID());
>
>       header.setTTL(destPeers.isEmpty() ? 200 : 1); //★My Problem
>       ... ...
> }
> ------------------------------------------------------------
> ★My Problem:
> Is there any special purpose to set TTL to 200 when destPeers is empty?
> #why not be set to any other number?

200 appears to be an arbitrary number chosen in this implementation, I
am sure there is good reason for it however.

>
> [Background of Problem]
> If TTL is set to a big number, I think it may lead bad influence to the overhead
> of network. To put down the overhead of network, may I set a number less than 200
> for TTL when destPeers is empty?

There should not be network overhead, the message will be forwarded
until such a time as a peer is found or TTL reaches zero, TTL
decrements every time it is forwarded to a new peer. Every peer who
receives the message and forwards it on must append themselves to the
vistedPeers list. Thus the message will expire once TTL reaches zero
or all peers have been visited. see more at
https://jxta-spec.dev.java.net/nonav/JXTAProtocols.html#fwhms

>
> Could you please give me any comment or suggestion? Any help will be appreciated.

I think you will find better information on one of the JXTA mailing
lists https://jxta.dev.java.net/servlets/ProjectMailingListList

>
> Best Regard
> Wu Jie
>

Cheers
Justin