Re: JxtaBiDiServer and Output Pipe compatibility

Mohamed Abdelaziz <[email protected]> Tue, 20 Sep 2005 09:51:32 -0700
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
There's no way to distinguish or describe the protocol behind a pipe, 
other than additional meta-data.   As far as describing a service 
protocol that's where the Module advertisements become handy by fully 
describing a service class, specification, and implementations.


Mohamed
note: JxtaServerPipe should have thrown an io exception in that condition.

-- 
http://blogs.sun.com/roller/page/hamada
http://weblogs.java.net/blog/hamada


Glenn wrote:

>Is there any way to distinguish when a pipe advertisement refers to a bidi pipe or a 'regular' pipe.
>
>When using a JxtaBidiServer I remote publish a pipe advertisement i and a client peer that uses JxtaBiDiPipe can locate and send/receive information from the server peer.  Unfortunately clients looking for a pipe advertisement (who will connect using an OutputPipe) can discover and attempt to use the pipe.  This behavior results in the following NullPointerException in the Server Peer:
>
>java.lang.NullPointerException
>        at net.jxta.util.JxtaBiDiPipe.lightweightOutputPipe(JxtaBiDiPipe.java:981)
>        at net.jxta.util.JxtaServerPipe.processMessage(JxtaServerPipe.java:434)
>        at net.jxta.util.JxtaServerPipe.accept(JxtaServerPipe.java:231)
>        at com.sarnoff.test.bidi.server.MessengerServiceImpl$ServerThread.run(MessengerServiceImpl.java:168)
>
>Using a JxtaBidiPipe to connect with a server with an InputPipe works as expected - the server can receive the message, but is obviously unable to successfully send a response.
>
>I understand an InputPipe is not compatible with a JxtaBidiServer, I'm just hoping there is a way to distinguish between the two in a pipe advertisement, to avoid the issue.
>
>Glenn
>  
>