在Web应用程序中使用WebSocket API



该截屏视频演示了如何使用WebSocket API和JSON创建一个简单的Web应用程序,该应用程序允许连接到单个WebSocket端点的客户端浏览器之间的协作。 。

3 comments
  1. Thanks, very good job ! If it's possible, could you demonstrate a step by step example how to do an application that implements Websocket with normal socket ? For example, I've got an managed bean running like ApplicationScoped that open a client socket conection that listen a server socket, when my client gets a new data from server the screen doesn't refresh, I need to type F5 again to refresh the information because managed bean instance is created and executed when I access the page (HTTP request). I'm monitoring a temperature sensor with managed bean client socket, each time that sensor changes the value, I need to update the HTML page without refresh. I thought to do it with a Websocket getting data from client socket throught the methods get and set, but it doesn't work. Another attempt that I made was comunicate a Websocket with a Socket but the protocols are diferent and the two aplication don't complete the handshake. Will be very useful if you can publish a video with this example, it's just a idea. Congratulations for the job in the video above, thank you very much !!!!!!!

Comments are closed.