WebSocket is a web communication protocol that allows two-way communication between a client and a server.
Oznacza to, że korzystając z WebSockets, nie musisz się martwić, że zapory sieciowe blokują ten port i uniemożliwiają przepływ danych pomiędzy klientem a serwerem.
This means that when using WebSockets you don’t have to worry about firewalls blocking that port and preventing your data to flow between client and server.
A jeśli chcesz wysłać dane na serwer, po prostu użyj kolejnej metody swojego tematu:
And if you want to send data to the server, simply use the next method of your subject:
W tym samouczku utworzymy prostą aplikację internetową, która implementuje przesyłanie wiadomości przy użyciu nowych możliwości protokołu WebSocket wprowadzonych w Spring Framework 4.0.
In this tutorial, we’ll create a simple web application that implements messaging using the new WebSocket capabilities introduced with Spring Framework 4.0.
Po nawiązaniu połączenia WebSocket połączenie pozostaje otwarte do czasu, aż klient lub serwer zdecyduje się je zamknąć.