在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.