0

I've got GCDWebServer up and running, bridged to Swift. What I am observing, via several tests, is that although the network connection hasn't changed, the web server hasn't stopped (not logged, dealloc breakpoints not hit, requests queue raised, stopped not called, delegate methods not hit) it simply just stops responding to incoming requests.

This would be on tvOS 9.1.1, it is repeatable. I am trying to debug why this is happening, but nothing is being logged to indicate a cause. Basically the last thing logged is like:

[DEBUG] Did open connection on socket 9
[DEBUG] Did connect
[DEBUG] Did start background task
[DEBUG] Connection received 339 bytes on socket 9
[DEBUG] Connection on socket 9 preflighting request "GET /" with 339 bytes body
[DEBUG] Connection on socket 9 processing request "GET /" with 339 bytes body
[DEBUG] Connection sent 182 bytes on socket 9
[DEBUG] Connection sent 44 bytes on socket 9
[DEBUG] Did close connection on socket 9
[VERBOSE] [fe80::...] fe80::... 200 "GET /" (339 | 226)
[DEBUG] Did disconnect
[DEBUG] Did end background task

...which is normal, and without any other indication it stops responding to requests with the app fully active and in the fore.

Is this an known issue or anything anyone else has experienced on tvOS?

  • Does this happen on the simulator and / or device? Are you sure you are keeping the GCDWebServer instance around too? – Pol Feb 03 '16 at 03:19
  • haven't tried in the sim, and the instance is retained.: `let webServer = GCDWebServer()` Additionally, as stated, I put a break in dealloc. Something is going on, but that's not it. Thanks for looking into this, Pierre-Olivier. – Kai Cherry Feb 03 '16 at 07:52
  • Additionally, i'm doing this via the .local hostname not the iP address. After switching to Swifty temporarily and spinning up an NSNetService, I am seeing inconsistent name resolving on tvOS...could be related, not sure. – Kai Cherry Feb 03 '16 at 08:00
  • You should try in the simulator as this will rule out any network issue since you will be entirely using local host. – Pol Feb 03 '16 at 15:21

0 Answers0