UDP

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

UDP

Postby janheuninck » 20 Mar 2012, 23:00

Hi,

I have some issues with the use of the UDP protocol in iOS.

1/ Initialization

Code: Select all

    // Initialize the UDP socket
    [smartFox initUDP:nil:-1];

According to http://docs2x.smartfoxserver.com/api-docs/objc-doc/Classes/SmartFox2XClient.html#//api/name/initUDP::: it isn't necessary to set the host and port parameters. If these are nil and -1 the values from the config file should be used. When I try this the program crashes on this line (SIGABRT). If I use the actual host and port as parameter everything works...

2/ Logging

When the client receives messages via UDP, the letter U is written to the console for every package:

Code: Select all

2012-03-20 15:57:30.540 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:30.580 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:30.623 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:30.665 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:30.706 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:33.548 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:33.592 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:33.633 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:33.676 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
2012-03-20 15:57:33.719 Client[2049:707] UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU


Is there a possibility to disable this logging? It's pretty annoying to debug...

Thanks!

PS: The debug mode is disabled:

Code: Select all

    // Initialize smartfox server
    smartFox = [[SmartFox2XClient alloc] initSmartFoxWithDebugMode:NO delegate:self];
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: UDP

Postby A51Integrated » 25 Mar 2012, 04:57

Can you please verify that you're using the latest version of the API? We are unable to replicate the crash when using initUDP with nil and -1. Make certain your config XML has

Code: Select all

<udpHost>xxx.xxx.xxx.xxx</udpHost>
   <udpPort>9934</udpPort>


The "u" issue is valid. It's simply a leftover NSLog from testing and will be removed in the next release.
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: UDP

Postby janheuninck » 25 Mar 2012, 08:52

A51Integrated wrote:Can you please verify that you're using the latest version of the API? We are unable to replicate the crash when using initUDP with nil and -1. Make certain your config XML has

Code: Select all

<udpHost>xxx.xxx.xxx.xxx</udpHost>
   <udpPort>9934</udpPort>


I used the "udpIp" tag instead of the "udpHost" tag in my configuration file. Now it works. Sorry for the misleading error :)

A51Integrated wrote:The "u" issue is valid. It's simply a leftover NSLog from testing and will be removed in the next release.

Thanks!

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 14 guests