initUDP after re-login

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

initUDP after re-login

Postby janheuninck » 30 Mar 2012, 00:40

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
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: initUDP after re-login

Postby A51Integrated » 30 Mar 2012, 01:38

Try disconnecting from the zone, then reconnecting and login again. That should clear the UDP socket properly.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: initUDP after re-login

Postby janheuninck » 30 Mar 2012, 23:25

That worked, looks weird, but it works :) Thanks for the quick response
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: initUDP after re-login

Postby A51Integrated » 30 Mar 2012, 23:46

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.
A51 Integrated

http://a51integrated.com / +1 416-703-2300

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 19 guests