Skip to main content

Gizzly websocket can not send from browser

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
charliesimms
Offline
Joined: 2013-01-11

I am very new to websockets and trying to learn how to use websockets with jquery and HTML5.

I was able to do the following:
- start my Grizzly server with my WebSocketApplication
- I am able to connect from my client google chrome to my grizzly server websocket
- I am able to send messages from the server to my client google chrome

What I am struggling to do is send messages from the client to my grizzly server websocket.

I have attached the code so if anybody can pass on there experiance I would truly be grateful.

Cheers
Charlie

AttachmentSize
streaming_mbed_example.zip26.51 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
oleksiys
Offline
Joined: 2006-01-25

Hi Charlie,

I'd recommend to use the latest available versions of Grizzly and Jersey dependeincies. The client code (javascript) also has some issues.
I've fixed what I could and it seems to work now. Pls. find the updated version of your project attached.

WBR.
Alexey.

charliesimms
Offline
Joined: 2013-01-11

Thanks working now.

In using sockets what best practice/patterns to using in requesting data from the server?

I am used to web and Rest services development and would like to know what would be the best approach when using websocket from client to server?

My interest is using html5/jquery/websockets in mobile apps and requesting data from back end systems?

Thanks for you help
Charlie