Closed lucianocn closed 8 years ago
Just adding a NSThread sleepForTimeInterval
, before the emit
, it got working properly now.
Any ideas?
NSURL* url = [[NSURL alloc] initWithString:SERVER_SOCKETIO_URL];
SocketIOClient *socket = [[SocketIOClient alloc] initWithSocketURL:url options:nil];
[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
NSLog(@"SocketIO: Connected.");
[NSThread sleepForTimeInterval:1.0];
NSLog(@"SocketIO: Joining room %@.", [Authenticator getUnitID]);
[socket emit:@"joinRoom" withItems:@[@{@"room": @"14"}]];
}];
Hi, Debugging with the server log I discovered that when the socket connects, most of time the emit
joinRoom
is being sent but rarely not (randomly).I would like to know if there is any problem in my code, or it could be something related to the lib?
Thanks,