-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dublicate response on new then get #7
Comments
I'm going to check out this bug. |
Ive got it on my local, there is a lot of change ive made, but if you just create 2 controllers, one to set new and then the other to get new, log the events and you will see that its dublicating. Il setup my dev remotely so you can see later on, i'l PM you the link |
I tried with two controllers and $new and $get methods but I didn't get your error. 'use strict';
angular.module('MyApp', ['ngWebsocket'])
.controller('TestCtrl', ['$websocket', function ($websocket) {
var ws = $websocket.$new({
url: 'ws://localhost:12345',
mock: true
});
ws.$on('$open', function () {
ws.$emit('hi', 'there');
});
ws.$on('hi', function (msg) {
console.log('TestCtrl > hi: ' + msg);
});
}])
.controller('LolCtrl', ['$websocket', function ($websocket) {
var ws = $websocket.$get('ws://localhost:12345');
ws.$on('hi', function (msg) {
console.log('LolCtrl > hi: ' + msg);
});
}]); The TestCtrl sends an event called 'hi' with 'hello' data: with a break point at $$send internal method, the debugger stops just once. Is it the test right? Can you please post some testing code to reply the bug? Wilk |
When initially creating .$new to open the WS, on another controller, if you do .$get, and listen to socket, it sends the messages twice to the socket, one from the new and one from the get instance.
I think this is a bug, im going to look into to see if i can fix it, any ideas will be helpful.
Thanks
The text was updated successfully, but these errors were encountered: