[JXTA discuss] PipeOutListener and timeouts

Christoph Mueller <[email protected]> Sun, 04 Sep 2005 16:37:50 +0200
Newsgroups gmane.comp.java.jxta.general
Message-ID <[email protected]>
When creating an outPutPipe to send messages, there seem to be two 
possibilities:

- make a blocking call that fails after timeout:
op = PipeService.CreateOutputPipe(adv, timeout);
op.sendMessage(msg);

- make a non-blocking call that includes a PipeOutListener:
PipeService.CreateOutputPipe(adv, new myListener(msg))

The non-blocking option seems to be better suited for my application, 
but how can I include a timeout in this case?

If the pipe could not be resolved after a certain (long) time I still 
want to abort creation and notify the application about the failure.

Has anyone already found a good solution for this?

Thanks for any help