Skip to content
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

socket.on:@"disconnect" callBack:(responceObject){} function not called on any auto disconnection #147

Open
PrasannaYuvitime opened this issue Nov 24, 2017 · 0 comments

Comments

@PrasannaYuvitime
Copy link

PrasannaYuvitime commented Nov 24, 2017

I am using socket.io for ios ,swift library and my socket disconnect listener not called on any auto disconnection while attempting infinite autoconnect....

self.socket = [[SocketIOClient alloc] initWithSocketURL:[NSURL URLWithString:[NSString stringWithFormat:kChatServer]]
                                             config:@{@"log": @YES,@"connectParams": @{@"Authorization":strToken}}];

self.socket.reconnects = true;
self.socket.reconnectWait = 5;
[self.socket connect];

//Socket disconnected
[self.socket on:@"disconnect" callback:^(NSArray * arrResponce, SocketAckEmitter * ackEmit) {
NSLog(@"kDisConnect called");
[[NSNotificationCenter defaultCenter] postNotificationName:kDisConnect object:arrResponce];
}];

[self.socket on:@"reconnect" callback:^(NSArray * arrResponce, SocketAckEmitter * ackEmit) {
NSLog(@"reconnect socket");

}];

//Socket reconnect_attempt
[self.socket on:@"reconnectAttempt" callback:^(NSArray * arrResponce, SocketAckEmitter * ackEmit) {
NSLog(@"reconnect_attempt socket");
 }];

@nuclearace please guide me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant