how to stop a connection attempt?

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

Moderators: Lapo, Bax

Post Reply
Yotam Harris
Posts: 16
Joined: 10 Oct 2013, 12:54

how to stop a connection attempt?

Post by Yotam Harris »

because smart fox connection from iOS device can take way too long time up to 4 min to return with a result that it can't connect. we want to stop the connection attempt with our own timeout. how will we do that?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to stop a connection attempt?

Post by Lapo »

There isn't a way that I know of.
The problem is not at the API level but it is caused by the OS TCP timeout. Once you start a connection you will need to wait for connection event, sooner or later :(
The best you can do is trashing the current SmartFox object and start a new one.
Lapo
--
gotoAndPlay()
...addicted to flash games
Yotam Harris
Posts: 16
Joined: 10 Oct 2013, 12:54

Re: how to stop a connection attempt?

Post by Yotam Harris »

yeah thats what we are trying to do.
but we cant properly release smartFox, when we try to do that during a connection attempt the app freezes.
in debug it looks like BitSwarmClient is holding the thread.
so when is it safe to release SmartFox?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to stop a connection attempt?

Post by Lapo »

I don't think there's a way to interrupt it, then.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply