You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by fredrossperry <fr...@gmail.com> on 2013/12/11 00:52:56 UTC

ServerSockect breaks on deactivate/suspend?

Building an iOS app using FlashBuilder 4.7 and Apache Flex 4.11.
Using ServerSocket to make an in-app HTTP server so I can use
StageWebView to view HTML5/Javascript content that's built into
the app.  Works great until I hit the screen lock button on the iPad.
After that point my ServerSocket stops working.
 
On Event.ACTIVATE, I can create a new ServerSocket on a different
port, and that works.  But the previous ServerSocket won't, nor can
I destroy it and start a new one on the SAME port (which is really
what I need to do).
 
Thoughts?  Questions?  thanks.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ServerSockect-breaks-on-deactivate-suspend-tp4156.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

RE: ServerSockect breaks on deactivate/suspend?

Posted by David Coleman <da...@hotmail.com>.
http://forums.adobe.com/message/4892155

AIR 3.3 onwards, action script developers can execute short task in 
the background along with audio playback and location updates on iOS. In
 order to execute task in background, you would need to set
1) NativeApplication.nativeApplication.executeInBackground = true (in action script)
2) swf version should be 16 or more
3) namespace should be 3.3 or more (in application descriptor)






> From: david_coleman_007@hotmail.com
> To: users@flex.apache.org
> Subject: RE: ServerSockect breaks on deactivate/suspend?
> Date: Mon, 16 Dec 2013 11:06:39 -0300
> 
> on deeper research i found this:
> 
> 
> 
>             
>               
>                   There's a Technical Note on this: http://developer.apple.com/library/ios/#technotes/tn2277/_index.html
> 
> 
> In my app, in the App Delegate:
> 
> 
> on applicationDidEnterBackground: I stop the HTTP serveron applicationWillEnterForeground: I start the HTTP serverThis makes the server usable after someone hits the lock screen.
> 
>               
>             
>           
> see if you have these events exposed in the AIR framework.  I bet you can work around this issue if they are.
> 
> 
> > From: david_coleman_007@hotmail.com
> > To: users@flex.apache.org
> > Subject: RE: ServerSockect breaks on deactivate/suspend?
> > Date: Mon, 16 Dec 2013 11:05:08 -0300
> > 
> > My initial reaction is that this should stay working in the background... however it may have something to do with the "suspend" state that iOS applies to an app when locking the device.  
> > 
> > https://github.com/robbiehanson/CocoaHTTPServer/issues/10
> > 
> > this appears to be an issue with the native socket implementation.  Perhaps the fork of this project can be used to hack some fix into the ServerSocket flex class...
> > 
> > > From: Pete.Thomas@dunnhumby.com
> > > To: users@flex.apache.org
> > > Date: Thu, 12 Dec 2013 11:01:13 +0000
> > > Subject: RE: ServerSockect breaks on deactivate/suspend?
> > > 
> > > Can you destroy on EVENT.DEACTIVATE?
> > > 
> > > -----Original Message-----
> > > From: fredrossperry [mailto:fredrossperry@gmail.com] 
> > > Sent: 10 December 2013 23:53
> > > To: users@flex.apache.org
> > > Subject: ServerSockect breaks on deactivate/suspend?
> > > 
> > > Building an iOS app using FlashBuilder 4.7 and Apache Flex 4.11.
> > > Using ServerSocket to make an in-app HTTP server so I can use StageWebView to view HTML5/Javascript content that's built into the app.  Works great until I hit the screen lock button on the iPad.
> > > After that point my ServerSocket stops working.
> > >  
> > > On Event.ACTIVATE, I can create a new ServerSocket on a different port, and that works.  But the previous ServerSocket won't, nor can I destroy it and start a new one on the SAME port (which is really what I need to do).
> > >  
> > > Thoughts?  Questions?  thanks.
> > > 
> > > 
> > > 
> > > --
> > > View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ServerSockect-breaks-on-deactivate-suspend-tp4156.html
> > > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> > > dunnhumby limited is a limited company registered in England and Wales with registered number 02388853 and VAT registered number 927 5871 83.
> > > Our registered office is at Aurora House, 71-75 Uxbridge Road, London W5 5SL.
> > > The contents of this message and any attachments to it are confidential and may be legally privileged.
> > > If you have received this message in error you should delete it from your system immediately and advise the sender.
> > > dunnhumby may monitor and record all emails. The views expressed in this email are those of the sender and not those of dunnhumby.
> > > 
> >  		 	   		  
>  		 	   		  
 		 	   		  

RE: ServerSockect breaks on deactivate/suspend?

Posted by David Coleman <da...@hotmail.com>.
on deeper research i found this:



            
              
                  There's a Technical Note on this: http://developer.apple.com/library/ios/#technotes/tn2277/_index.html


In my app, in the App Delegate:


on applicationDidEnterBackground: I stop the HTTP serveron applicationWillEnterForeground: I start the HTTP serverThis makes the server usable after someone hits the lock screen.

              
            
          
see if you have these events exposed in the AIR framework.  I bet you can work around this issue if they are.


> From: david_coleman_007@hotmail.com
> To: users@flex.apache.org
> Subject: RE: ServerSockect breaks on deactivate/suspend?
> Date: Mon, 16 Dec 2013 11:05:08 -0300
> 
> My initial reaction is that this should stay working in the background... however it may have something to do with the "suspend" state that iOS applies to an app when locking the device.  
> 
> https://github.com/robbiehanson/CocoaHTTPServer/issues/10
> 
> this appears to be an issue with the native socket implementation.  Perhaps the fork of this project can be used to hack some fix into the ServerSocket flex class...
> 
> > From: Pete.Thomas@dunnhumby.com
> > To: users@flex.apache.org
> > Date: Thu, 12 Dec 2013 11:01:13 +0000
> > Subject: RE: ServerSockect breaks on deactivate/suspend?
> > 
> > Can you destroy on EVENT.DEACTIVATE?
> > 
> > -----Original Message-----
> > From: fredrossperry [mailto:fredrossperry@gmail.com] 
> > Sent: 10 December 2013 23:53
> > To: users@flex.apache.org
> > Subject: ServerSockect breaks on deactivate/suspend?
> > 
> > Building an iOS app using FlashBuilder 4.7 and Apache Flex 4.11.
> > Using ServerSocket to make an in-app HTTP server so I can use StageWebView to view HTML5/Javascript content that's built into the app.  Works great until I hit the screen lock button on the iPad.
> > After that point my ServerSocket stops working.
> >  
> > On Event.ACTIVATE, I can create a new ServerSocket on a different port, and that works.  But the previous ServerSocket won't, nor can I destroy it and start a new one on the SAME port (which is really what I need to do).
> >  
> > Thoughts?  Questions?  thanks.
> > 
> > 
> > 
> > --
> > View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ServerSockect-breaks-on-deactivate-suspend-tp4156.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> > dunnhumby limited is a limited company registered in England and Wales with registered number 02388853 and VAT registered number 927 5871 83.
> > Our registered office is at Aurora House, 71-75 Uxbridge Road, London W5 5SL.
> > The contents of this message and any attachments to it are confidential and may be legally privileged.
> > If you have received this message in error you should delete it from your system immediately and advise the sender.
> > dunnhumby may monitor and record all emails. The views expressed in this email are those of the sender and not those of dunnhumby.
> > 
>  		 	   		  
 		 	   		  

RE: ServerSockect breaks on deactivate/suspend?

Posted by David Coleman <da...@hotmail.com>.
My initial reaction is that this should stay working in the background... however it may have something to do with the "suspend" state that iOS applies to an app when locking the device.  

https://github.com/robbiehanson/CocoaHTTPServer/issues/10

this appears to be an issue with the native socket implementation.  Perhaps the fork of this project can be used to hack some fix into the ServerSocket flex class...

> From: Pete.Thomas@dunnhumby.com
> To: users@flex.apache.org
> Date: Thu, 12 Dec 2013 11:01:13 +0000
> Subject: RE: ServerSockect breaks on deactivate/suspend?
> 
> Can you destroy on EVENT.DEACTIVATE?
> 
> -----Original Message-----
> From: fredrossperry [mailto:fredrossperry@gmail.com] 
> Sent: 10 December 2013 23:53
> To: users@flex.apache.org
> Subject: ServerSockect breaks on deactivate/suspend?
> 
> Building an iOS app using FlashBuilder 4.7 and Apache Flex 4.11.
> Using ServerSocket to make an in-app HTTP server so I can use StageWebView to view HTML5/Javascript content that's built into the app.  Works great until I hit the screen lock button on the iPad.
> After that point my ServerSocket stops working.
>  
> On Event.ACTIVATE, I can create a new ServerSocket on a different port, and that works.  But the previous ServerSocket won't, nor can I destroy it and start a new one on the SAME port (which is really what I need to do).
>  
> Thoughts?  Questions?  thanks.
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ServerSockect-breaks-on-deactivate-suspend-tp4156.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
> dunnhumby limited is a limited company registered in England and Wales with registered number 02388853 and VAT registered number 927 5871 83.
> Our registered office is at Aurora House, 71-75 Uxbridge Road, London W5 5SL.
> The contents of this message and any attachments to it are confidential and may be legally privileged.
> If you have received this message in error you should delete it from your system immediately and advise the sender.
> dunnhumby may monitor and record all emails. The views expressed in this email are those of the sender and not those of dunnhumby.
> 
 		 	   		  

RE: ServerSockect breaks on deactivate/suspend?

Posted by Pete Thomas <Pe...@dunnhumby.com>.
Can you destroy on EVENT.DEACTIVATE?

-----Original Message-----
From: fredrossperry [mailto:fredrossperry@gmail.com] 
Sent: 10 December 2013 23:53
To: users@flex.apache.org
Subject: ServerSockect breaks on deactivate/suspend?

Building an iOS app using FlashBuilder 4.7 and Apache Flex 4.11.
Using ServerSocket to make an in-app HTTP server so I can use StageWebView to view HTML5/Javascript content that's built into the app.  Works great until I hit the screen lock button on the iPad.
After that point my ServerSocket stops working.
 
On Event.ACTIVATE, I can create a new ServerSocket on a different port, and that works.  But the previous ServerSocket won't, nor can I destroy it and start a new one on the SAME port (which is really what I need to do).
 
Thoughts?  Questions?  thanks.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ServerSockect-breaks-on-deactivate-suspend-tp4156.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
dunnhumby limited is a limited company registered in England and Wales with registered number 02388853 and VAT registered number 927 5871 83.
Our registered office is at Aurora House, 71-75 Uxbridge Road, London W5 5SL.
The contents of this message and any attachments to it are confidential and may be legally privileged.
If you have received this message in error you should delete it from your system immediately and advise the sender.
dunnhumby may monitor and record all emails. The views expressed in this email are those of the sender and not those of dunnhumby.