Skip to main content

Problems sending message via EndpointService.getMessenger() with ADHOC Peers

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
endersonmaia
Offline
Joined: 2010-12-16

Hi,

I'm trying to send a message between two ADHOC peers in the same
machine, using the EndpointService.getMenssenger(PeerID.toURI).

After EndPointService.isReachable() returning "true" I try to use
Messenger.sendMessage() and returns true.

But the MessageArriveListener.messageArrived() is not catch and I stop
in this error:

AVISO: Line 966
net.jxta.impl.endpoint.EndpointServiceImpl.processIncomingMessage()
dest serviceName must not be null, discarding message
net.jxta.endpoint.Message@1159656515(8){2}
The code and more details can be found at : https://gist.github.com/800368

I'm trying to make this example as simple as possible with ADHOC and
no RDV, all in local machine, just to get a message from one Peer to
another.

What am I missing ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
endersonmaia
Offline
Joined: 2010-12-16

I solved it extending the EndpointService and used addIncomingMessageListener() te register the service names.
Don't know if its the best solution, but now I can get the message with processIncomingMessage()