• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Spring 4 Websockets vs other websockets frameworks with fallback options.

 
Greenhorn
Posts: 14
MyEclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys.
I'm planning to create a simple multiplayer games with websockets.
My goals are:
-can be play on mobile, should be lightweight.
-it should have fallback options in case browser doesn't support websockets.
-can integrate with Spring.


Frameworks that I researched so far are :
1. Spring 4 Websockets with Stomp and SockJs
2. Atmosphere
3. Netty
4. jWebsockets
5. Resin?

What is the best framework for this? What are the pros and cons of using them?
Suggestions would much be appreciated.
Thanks.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding this thread to the sockets forum

I've not played with all those libraries. I've only worked with netty. IME netty is awesome if you wanna go really low level. It's little hard to work with though. However, it gives really good performance. I would go with netty only if you are hyper focused on performance.
 
Kent de Guzman
Greenhorn
Posts: 14
MyEclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jayesh Thanks. Netty is actually my first choice since one of my focus is a good performance even though I think it will give me a hard time. Netty also support Spring. Do you think netty support automatic fallback options?
Example would be from websockets to long polling in case browser doesn't support websockets.
 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll have to implement the handshake yourself or find some code that has the implementation. Websockets supports fallback to normal http. If the client sends a websocket header, you are websocket, otherwise you are http.

So you can do it in netty. It's just going to be very clunky. In netty, you basically have a chain of handlers. Which means its not simple to handle different requests differently. Each handler will need to know whether to handle the input or just pass through. Google for a sample on how to implement handshaking in netty and you will see.

The performance benefit might not be huge. We are talking about tenths/hundredths of milliseconds. Depending on what you are doing at the app layer, this optimization may not be worth it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic