Closed brodenbrett closed 2 months ago
To anyone who comes across this looking for a solution - I ended up moving forward using the socket.io-client
package.
@brodenbrett is rxjs for web sockets better than socket.io-client?
@brodenbrett is rxjs for web sockets better than socket.io-client?
I had a very simple implementation; a user connects, joins a room, and listens for a single event with no data. For my purposes there wasn't a stark difference between the two packages, I can't speak to more complex implementations.
That said, ngx-socket-io
is easier to implement since you inject a service into your components, and you're only ever dealing with a single socket object/connection. If you use socket.io-client
you'll likely have to create your own service. I'd consider ngx-socket-io
the preferred way to do things.
any news ?
I have question about ngx-socket.io design does it have to be inside service? can i just use the socket anywhere on any component? all of those will still act in the same socket right?
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
When a connection is made to the WebSocket server, the initial
connect
event does not fire. If the server or client is disconnected and then re-connects, subsequentconnect
events do fire.The client is still connected and can receive other events from the server despite the
connect
event never having fired. EG:Note that using the equivalent code with the
socket.io-client
plugin works as expected, which implies an issue within the plugin rather then the server or network:Socket.IO Server version: v4.6.2 ngx-socket-io version: v4.6.1 Angular version: 17.0.4
Possible related issues here and here.