Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the connection between WebSockets and Asynchronous Servlet technologies?

From my basic understanding of both WebSockets as well as Asynchronous Servlet technologies,it seems like both are technologies to support server push of data to browsers. I want to understand the overlap of these two technolgies? Are they complementary or are they two technologies that have a common goal?

P.S: I am looking at the connection between these two technologies from the perspective of the client as well as the server.

like image 861
Geek Avatar asked Oct 21 '22 15:10

Geek


1 Answers

From wiki's definition: "WebSocket is a web technology providing full-duplex communications channels over a single TCP connection", so it's just like an communication protocol between client and server, like HTTP protocol.

Asynchronous Servlet technologies is Java's servlet solution for serving asynchronous request. It's just a programming approach to support async on the server side, and don't care the communication protocol between client and server (that's servlet container's job).

For now with servlet specification 3, WebSockets is not supported. But seems we can see it in the next Servlet specification, then we can use WebSockets under some Servlet container like Tomcat or Jetty directly, but the asynchronous Servlet technologies maybe still as same as today's we use.

It's just my understanding, hope it's right and help.

like image 130
donnior Avatar answered Oct 28 '22 20:10

donnior