Using multiple sockets
See original GitHub issueTrying to use two sockets as per instructions gives me errors.
I have added socket in providers array in page module.
providers: [Socket]
In app.module: import { Socket } from ‘ngx-socket-io’; and the two export class SocketOne extends Socket { …
providers: [ SocketOne, SocketTwo,
This is in an Ionic 4 /Angular 7 app.
This is my error: ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[WrappedSocket -> InjectionToken SOCKET_IO_CONFIG]: StaticInjectorError(Platform: core)[WrappedSocket -> InjectionToken SOCKET_IO_CONFIG]: NullInjectorError: No provider for InjectionToken SOCKET_IO_CONFIG!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Can a process have multiple sockets? - Quora
The short answer is yes. The longer answer is still yes, but you need to handle them properly. I'm going to assume you're...
Read more >Using multiple nodes | Socket.IO
When deploying multiple Socket.IO servers, there are two things to take care of: enabling sticky session, if HTTP long-polling is enabled (which ...
Read more >Socket Programming in C/C++: Handling multiple clients on ...
A better way to handle multiple clients is by using select() linux ... //Handle multiple socket connections with select and fd_set on Linux....
Read more >Handle multiple socket connections with fd_set and select on ...
In this tutorial we shall use the select method approach. The select function allows the program to monitor multiple sockets for a certain...
Read more >Receiving data from multiple sockets at once (Multithreading)
When a remote client connects to it, a communication channel (i.e. socket) is created. If another client connects, another socket is created.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I went this route:
I have two services, each accessing a socket, or in my case, different Namespaces of the same socket. In each service, I use the following:
“thenamespace” is all that is changed between the two services. In the service constructor: public socket: Socket1,
Now I just access each socket, from each service as I need them.
This issue is over a year old now, if the issue hasn’t been resolved then please feel free to open up a new ticket, just so we can track new issues and get rid of the clutter