I've 2 peers trying to start their own channel on the
each other's Profile on a shared
Session.
Peer A to Peer B communication is fine. When Peer B
tries to reuse the
received Session object to start the Channel using
session.startChannel(ProfileA),
I get this exception of Unsupported profile.
Here's the code on PeerA:
public class Client implements
Profile,StartChannelListener,org.beepcore.beep.core.Requ
estHandler
{
....register profileA
reg.addStartChannelListener(uri,
p.init(uri, profileConfig),
tuning);
...
//initiate session
session = TCPSessionCreator.initiate(host, port);
channel = session.startChanne(ProfileB);
Now send the message here.. Works fine
//Has other callbacks implemented similar to
EchoProfile
}
Code on PeerB:
public class Server implements
Profile,StartChannelListener,org.beepcore.beep.core.Requ
estHandler
{
....register profileB
reg.addStartChannelListener(uri,
p.init(uri, profileConfig),
tuning);
...
public void startChannel(Channel channel, String
encoding, String data)
throws StartChannelException
{
channel.setRequestHandler(this);
//STORE THE SESSION here.. is this a problem??
peerSession = channel.getSession();
}
//Has other callbacks implemented similar to
EchoProfile
}
On the PeerB side, in a different Java class I try to
use the peerSession object above to startChanel that's
when I get the exception:
org.beepcore.beep.core.SessionImpl$StartReplyListener
receiveERR
> SEVERE: Received an error in response to a start.
code=550
> diagnostic=all requested profiles are unsupported
This is how I call startChannel:
Channel channel;
try {
//session object being used here
is stored after this peer received the message from the
other Peer. Can I use this stored session to start a
Channel on the other peers' profile?? This where I get
the exception.
channel =
session.startChannel(ProfileA);
} catch (BEEPError e) {
}
I checked the profile info on both sides and are OK.
In summary, PeerA to PeerB communication is OK
PeerB also receives the Reply from PeerA. But PeerB
can't startChannel() on peerA.