Hi all,
I'm not sure if this is the right forum to ask.I have implemented Channel
API in my gwt project.It creates token but when i try to open a channel it
doesn't seem to work.In onOpen() method I try to log info on the server that
channel has been opened but it doesn't work.Can anyone have a look and tell
me it is not working.I ran out of ideas.Have really bad time with
implementing channel.There is my code from onModuleLoad( ) [class filesfor
channel,socket and socket listener are from dance,dance robot app]:
private void listenToChannel() {
Window.alert("listen to channel..");
if(cca==null){
cca=(ChatChannelAsync) GWT.create(ChatChannel.class);
((ServiceDefTarget) cca).setServiceEntryPoint("ChatChannel");
}
((ServiceDefTarget) cca).setServiceEntryPoint("ChatChannel");
AsyncCallback<String> callback=new AsyncCallback<String>(){
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.toString());
}
@Override
public void onSuccess(String result) {
Channel channel=ChannelFactory.createChannel(result);
channel.open(new SocketListener(){
@Override
public void onOpen() {
Logger log=Logger.getLogger(CryptoChat.class.getName());
log.info("channel open");
}
@Override
public void onMessage(String message) {
try {
SerializationStreamReader reader =
pushServiceStreamFactory.createStreamReader(message);
String msg = (String) reader.readString();
int i=message.indexOf("says");
String contact=message.substring(0, i-1);
handleMessage(msg,contact);
} catch (SerializationException e) {
throw new RuntimeException("Unable to deserialize " +
message, e);
}
}
});
}
};
cca.createChannel(callback);
}
THANKS FOR ANY HELP!
Ania
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.