Page 1 of 1

initUDP after re-login

Posted: 30 Mar 2012, 00:40
by janheuninck
I initialize my UDP connection after a user has logged in:

Code: Select all

- (void)onLogin:(SFSEvent *)evt
{
    // Login successful
    NSLog(@"Logged In");
   
    // Initialize the UDP socket
    [smartFox initUDP:nil:-1];
}


This works well, but when the user logs out, and logs in again, there is a problem with the UDP connection when I'm sending messages over UDP:

Code: Select all

2012-03-29 17:36:57.541 XXX[2203:707] [SFS - WARN]UDP protocol is not initialized yet. Pleas use the -(void)initUDP method.


Is this a bug or am I doing something wrong?


Thanks

Re: initUDP after re-login

Posted: 30 Mar 2012, 01:38
by A51Integrated
Try disconnecting from the zone, then reconnecting and login again. That should clear the UDP socket properly.

Re: initUDP after re-login

Posted: 30 Mar 2012, 23:25
by janheuninck
That worked, looks weird, but it works :) Thanks for the quick response

Re: initUDP after re-login

Posted: 30 Mar 2012, 23:46
by A51Integrated
Well, it makes sense. I can't think of many scenarios where one would log out without disconnection. This way, you're sure to gracefully close the connection as well.