On Wednesday, 25 August 2021 at 22:31:31 UTC+2 Higherous wrote:

> Hello all.  How do I need to start my server written in Go and used in the 
> iOS app?
> I tried as in many tutorials, just
>
> *ServerStartArg("8090", documentDirectory[0])*
>
> This starts the server, but the application freezes.
>
> Next, tried  to do this in background thread
>
> *DispatchQueue.global(qos: .background).async {*
>
> *          ServerStartArg("8090", documentDirectory[0])*
>
> *}*
>
> The server starts and the application works. But there is a problem. When 
> application un tray (not opened, but also not closed) server don't respond
>
> And here's is a question: How to start a server without these two problems?
>

iOS has strict limits on background processing. See 
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622997-applicationdidenterbackground?language=objc:

"Return from applicationDidEnterBackground: as quickly as possible. Your 
implementation of this method has approximately five seconds to perform any 
tasks and return. If the method doesn’t return before time runs out, your 
app is terminated and purged from memory."

Elias

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f1ffb443-0614-45c4-b0fb-7e2f1353cc5fn%40googlegroups.com.

Reply via email to