btford / btford/angular-socket-io

How to reset sockets?

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.5k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Hello;

I have following service in my code:

```
getSocket: function(shopId) {
var ioWebSocket = io.connect($location.protocol() + '://' + $location.host() + ':' + $location.port() + '/web', {
query: "shop=" + shopId
});
var mySocket = socketFactory({
ioSocket: ioWebSocket
});
mySocket.forward('feedback');
mySocket.forward('order');
mySocket.forward('deviceCount');
return mySocket;
}
```

Here shops can be changed. But whenever I call getSocket service, it returns me same socket. It should be disconnect from one socket and connect to another one but it does not. How can I solve that?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.