JWebSocket using GWT

394 views
Skip to first unread message

Guess What

unread,
Apr 22, 2011, 9:34:50 PM4/22/11
to Google Web Toolkit
Folks , I am build a chat Server App in GWT .I came across
JWebSocket . (http://jwebsocket.org/)
This seems to be useful . But I am not sure how to build using GWT .
Has anybody worked on this or can give me some example of how to wrap
the JWebScoket calls in GWT . .

gail...@audemat.com

unread,
Apr 23, 2011, 9:42:10 AM4/23/11
to Google Web Toolkit
On GWT client side, you can use this project : http://code.google.com/p/gwt-websockets/

gangurg gangurg

unread,
Apr 23, 2011, 12:42:46 PM4/23/11
to google-we...@googlegroups.com
Thanks for the reply . I see the project is tested against JWebSocket .How did you guys invoke JWebScoket  from the Client . Can you kindly share that piece of code or the structure you guys adopted . 
 

On Sat, Apr 23, 2011 at 6:42 AM, gail...@audemat.com <gail...@audemat.com> wrote:
On GWT client side, you can use this project : http://code.google.com/p/gwt-websockets/

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


gail...@audemat.com

unread,
Apr 25, 2011, 8:33:31 AM4/25/11
to Google Web Toolkit
you have just to create a new class that implements WebSocketCallback
like this :

class tt implements WebSocketCallback {

@Override
public void connected() {
// TODO Auto-generated method stub

}

@Override
public void disconnected() {
// TODO Auto-generated method stub

}

@Override
public void message(String message) {
// if your server reply to HELLO sent
// response is here
System.out.println(message);

}

@Override
public void error(String message) {
// TODO Auto-generated method stub

}

@Override
public void info(String message) {
// TODO Auto-generated method stub
}

then a method in another class


public void zz() {
WebSocketClient client = new WebSocketClient(new tt());
client.connect("ws://your_server_ip_or_address");
client.send("HELLO");
}

mukarev

unread,
Jan 7, 2013, 10:18:07 AM1/7/13
to google-we...@googlegroups.com
I made a wrapper for the jWebSocket client stuff - have a look here -> https://github.com/mukarev/gWebSocket
Reply all
Reply to author
Forward
0 new messages