Cannot connect to SFS2X without wifi

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

Moderators: Lapo, Bax

clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Cannot connect to SFS2X without wifi

Postby clam61 » 09 Sep 2013, 21:52

Is this supported? I thought it would be. Maybe I am not doing something correctly?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Cannot connect to SFS2X without wifi

Postby rjgtav » 10 Sep 2013, 02:12

Hi there,

Hmm... Maybe your mobile connection provider's network doesn't support TCP connections?
Are you getting any error on the client? And/or any on the Server?
Can you provide further details of your setup?

Thanks
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 10 Sep 2013, 02:28

I see this:

purgeIdleCellConnections: found one to purge conn = 0x1cd5b1e0
purgeIdleCellConnections: found one to purge conn = 0x1cd79230
purgeIdleCellConnections: found one to purge conn = 0x1cdf3940


The function:

Code: Select all

-(void)onConnection:(SFSEvent *)evt


is called and of course the smartfox instance is not connected. if TCP is not supported, isn't bluebox supposed to be used automatically?

if I set up blueBox = YES I get

purgeIdleCellConnections: found one to purge conn = 0x1fd95760
purgeIdleCellConnections: found one to purge conn = 0x1fd94510
purgeIdleCellConnections: found one to purge conn = 0x1fd60500
purgeIdleCellConnections: found one to purge conn = 0x1fd7f9a0
purgeIdleCellConnections: found one to purge conn = 0x1fd7de60
purgeIdleCellConnections: found one to purge conn = 0x1fdf1800
2013-09-09 19:04:04.198 Test[534:907] [SFS - INFO][ BB-Send ]: sfsHttp=null%7Cconnect%7Cnull


Code: Select all

-(void)onConnection:(SFSEvent *)evt {
    [self sendNotification:CLEAR_LOADING];
    if (_smartFox.isConnected) {
        [self login];
    }
    else {
        [self sendNotification:SHOW_ALERT body:@"Could not connect to game server. Trying again..."];
        [self connect];
    }
}


also, when onConnection is called, I try to connect again and it logs:

2013-09-09 19:04:04.525 Test[534:907] [SFS - WARN]A connection attempt is already running
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Cannot connect to SFS2X without wifi

Postby rjgtav » 10 Sep 2013, 09:14

Please make sure that you're running the latest Client API, version 1.1.8, from:
http://www.smartfoxserver.com/download/sfs2x#p=client
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 10 Sep 2013, 09:50

id rather stick with 1.1.5 for maximum compatibility--does 1.1.5 have the ability to connect without wifi?

1.1.8 is not compatible with iOS 5, right? this is a problem.

1.1.7 -- is that compatible with arm7?

btw this is how i am initializing SFS2X. It is not using blue box even though I am specifying bluebox.

Code: Select all

-(void)createSFS2x {

     _smartFox = [[SmartFox2XClient alloc] initSmartFoxWithDebugMode:YES delegate:self];

    _smartFox.useBlueBox = YES;
    NSLog(@"%@",    [_smartFox version]);
}
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Cannot connect to SFS2X without wifi

Postby rjgtav » 10 Sep 2013, 20:58

Hmm, I see that some people are misreading Lapo's post regarding 1.1.8... ;)

When it was first built, the API's developers compiled the v1.1.8 with an iOS 6 SDK, which, of course, made it unable to run on iOS 5.
After this was reported by an User, it was sent to the developers to fix it and I'm pretty sure that the new 1.1.8 version compiled with iOS 5 is already available at http://www.smartfoxserver.com/download/sfs2x#p=client, but I'll call Lapo to confirm this at this topic.

Regarding your BlueBox question, the API will only try a BlueBox connection in case it failed to establish a direct Socket connection, because HTTP is a much slower protocol and it should only be used as a last resort.

Hope this helps
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 10 Sep 2013, 22:12

lapo's last post in hte 1.1.8 thread was, "I will go back to our developers and let you know. Thanks for posting."

hopefully with 1.1.8 you can connect to smartfox without wifi (have you ever heard of this problem before)

in 1.1.5 when the connection fails onConnection: is called, connected is NO and no attempt to connect via blueBox is made.

in 1.1.5 even if I set useBlueBox = YES before calling connect, no connection is made without wifi.

of course this is all moot if 1.1.8 is compatible with iOS 5.

I will await to hear the status. Thanks.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot connect to SFS2X without wifi

Postby Lapo » 11 Sep 2013, 08:50

We have a new release of the version 1.1.8 which is compatible with iOS 5.
You can drop us an email to our support@... email box if you want to try it in advance. It will be out early next week.
Lapo
--
gotoAndPlay()
...addicted to flash games
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 18 Sep 2013, 21:52

Is anyone else having this problem or just me? i mean, bluebox for this version does not work. thats a pretty big feature that's missing.
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 21 Sep 2013, 01:11

rjgtav

You said maybe my provider does not support TCP, but doesnt HTTP run on top of TCP? If I can bring up a webpage that means my provider supports TCP
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot connect to SFS2X without wifi

Postby Lapo » 22 Sep 2013, 08:28

clam61 wrote:rjgtav

You said maybe my provider does not support TCP, but doesnt HTTP run on top of TCP? If I can bring up a webpage that means my provider supports TCP

There might be limitations on the port ranges you can use.
To test this you can write a simple test app that opens a TCP socket towards port 9933, SFS2X default port.

The server will accept the connection and it will drop it after a while (20-30 secs) since your app doesn't provide a regular handshake, but this is sufficient to test TCP and see which ports are limited, if any.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Cannot connect to SFS2X without wifi

Postby clam61 » 24 Sep 2013, 06:06

i tried writing a small app to connect via socket

it works over 3G with port 80 as expected but doesnt work with a lot of other standard ports (20,22, etc).

looks like i should just rely on bluebox with a 3g connection, but the problem is that smartfox runs http over 8080, and i cannot access that port either via 3g

should i put smartfox on a subdomain of my main site and run http or the TCP socket over 8080?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot connect to SFS2X without wifi

Postby Lapo » 24 Sep 2013, 08:54

The best idea in this case is to run SmartFoxServer on port 80 and the BlueBox on port 443 (HTTPs)
This way all clients should be able to connect in one way or another.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 54 guests