UDP packets & GWT

147 views
Skip to first unread message

Andre Leger

unread,
Nov 9, 2009, 8:42:12 AM11/9/09
to Google Web Toolkit
Greetings,

I know this is not a pure GWT question, but a related one.

I have a web device that continuously sends UDP packets to a specific
IP and port. I have a java application that is able to listen to the
port and receive the packets.

What I want to do is create an OpenSocial gadget in GWT that will
somehow take the data and be displayed in the gadget. I understand
that I am not able to use the java.net.DatagramSocket and
java.net.DatagramPacket classes in GWT because javascript does not
support socket listening.

Anyone out there have a simple solution that would enable me to get
the datagram data somehow. I would appreciate any suggestions.

Thank you,

Andre

Paul Robinson

unread,
Nov 9, 2009, 8:55:25 AM11/9/09
to google-we...@googlegroups.com
Run your java app on a server somewhere that can receive the UDP
packets, and then store them (in memory or in a database). GWT client
connects to your server to get the data

gwtfanb0y

unread,
Nov 9, 2009, 9:37:52 AM11/9/09
to Google Web Toolkit
If you want to use reverse ajax (or push ajax) i would recommend
comet.

mariyan nenchev

unread,
Nov 11, 2009, 5:52:10 AM11/11/09
to google-we...@googlegroups.com
Make blocking rpc calls to the server and when datagram packet is received transform the data in some string format and unblock the async call with the string result

Andre Leger

unread,
Nov 22, 2009, 4:12:44 PM11/22/09
to Google Web Toolkit
For an update, what I did is output the data to an xml file on the
server, then fetch the data with a simple http GET using
RequestBuilder. To deal with SOP, I had to put the xml file on the
same domain as my shindig container.

Thanks for the help, it is always appreciated.

Andre
Reply all
Reply to author
Forward
0 new messages