This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

WebSockets with Servlets

 
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a bit confused as to which Servlet specification version has WebSocket support and what is the Java EE version for it? Does Servlet spec 3.1 requires a Java EE 7 container? The reason being that I want to use WebSockets in one of my WebApp and I'm aware that WebSocket support is available only with Servlet spec 3.1.

Does the Java EE 7 container like Glassfish 4 or Tomcat 7 require Java 7? Can't it run with Java 6?
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 7 is a JEE 6 container; Tomcat 8 will support JEE 7. However, Tomcat 7 does support WebSockets if you use Java 7. See http://tomcat.apache.org/whichversion.html.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that. Are WebSockets communication between client and server is always asynchronous?
 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are plenty of WebSocket tutorials on the web that can answer your basic questions.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:There are plenty of WebSocket tutorials on the web that can answer your basic questions.



It was actually one of those poorly written tutorials that actually got me confused. That is the reason why in the first place, I posted my question here. If I have to trust Wikipedia, WebSockets are by default not asynchronous. I just wanted to know from fellow ranchers if they have used WebSockets in asynchronous mode?
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Joe Harry wrote: If I have to trust Wikipedia, WebSockets are by default not asynchronous.



They are not designed to be synchronous, only asynchronous otherwise the full duplex communication would be faked. It doesn't make sense to want to use them synchronously. It's really like asking if you can use a boat in the air instead of in water. You could make some modifications to make it happen but what would be the point of that.

Which statement on Wikipedia suggests that "WebSockets are by default not asynchronous."?
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

E Armitage wrote:
They are not designed to be synchronous, only asynchronous otherwise the full duplex communication would be faked. It doesn't make sense to want to use them synchronously. It's really like asking if you can use a boat in the air instead of in water. You could make some modifications to make it happen but what would be the point of that.

Which statement on Wikipedia suggests that "WebSockets are by default not asynchronous."?



Wikipedia just does not say that it is asynchronous. It actually does not say anything about this. What you say makes sense to me. If I think about a full duplex communication mode, like a land line telephone, it justifies to me that WebSockets in nature is asynchronous.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's still a stretch to conclude that Wikipedia suggests that Websockets are by default not asynchronous.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!