issues with JxtaBiDiPipe

"John D. Blair" <[email protected]> Sun, 18 Sep 2005 21:48:53 -0700
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
I'm experimenting with using JxtaBiDiPipe.  I use a JxtaBiDiPipe to 
create a reliable bidirectional pipe from a client to a server.  I have 
been examining what happens if the server side (the side with the 
JxtaServerPipe instance) fails and exits ungracefully, without making 
any attempt to tear down the pipe.  When this happens, I see the 
following:

1) The JxtaBiDiPipe on the client side continues to accept messages for 
about 30 seconds, throwing no exceptions and returning true as if it is 
working properly.

2) After about 30 more seconds it throws IOException: stream is being 
closed.  It continues to throw this exception for as long as I have 
watched the program run (about 5 minutes).  A stack trace indicates the 
exception is originating from ReliableOutputStream.

Attempting to close the pipe in response to the IOException has no 
effect on the situation, presumably b/c it is being closed already.  
However, it never seems to finish closing.  Further, if I start the 
server side back up again (either before the exceptions begin to be 
thrown, or after), the client side never rediscovers the server side of 
the pipe and re-establishes the connection.  Since I see this 
rediscovery behavior when using pairs of ordinary OutputPipe/InputPipe 
objects, I was hoping to see it with JxtaBiDiPipes as well.

My question:

Is this expected behavior, or is this a bug?  If this is expected 
behavior, how do I discard the JxtaBiDiPipe that is no longer working 
so I can free its resources and open a new connection?

Thanks much for the help!

Aside: I was hoping the bidi pipe would deal with the failure of the 
remote endpoint the way the conventional OutputPipe does-- by searching 
for a new peer advertising the same pipe and connecting to it.