I am gonna develop a real time game for andriod/ios and i need a server which transmit data with client real time. Can i use socket.io with Spring boot? Or if the answer is no , using websockets with Spring boot is the solution?
Socket.IO is a library that enables low-latency, bidirectional and event-based communication between a client and a server. It is built on top of the WebSocket protocol and provides additional guarantees like fallback to HTTP long-polling or automatic reconnection.
WebSocket is a technology that enables two-way realtime communication between client and server. In contrast, Socket.IO is a library that provides an abstraction layer on top of WebSockets, making it easier to create realtime applications.
Socket.IO can be used based on the Express server just as easily as it can run on a standard Node HTTP server. In this section, we will fire the Express server and ensure that it can talk to the client side via Socket.IO.
The original Socket.IO server is designed to be used in Javascript, mostly Node.
Yet, there are other implementations of the Socket.IO server for other languages.
For Java, there is the Netty-socketio project, an open-source Java implementation of the Socket.IO server, based on the Netty Java server framework (the Netty-socketio project is also suggested in this answer).
This example Spring Boot application uses Netty-socketio to provide a Socket.IO server within a Spring Boot application.
So yes, you can use (on open-source Java implementation) of Socket.IO together with Spring Boot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With