When the app is suspended, is the server connection technically closed? When the user foregrounds the app again and the port has been set as 0, how likely is it that it will start with a different port? Just wondering what sort of cases to handle when my app has already passed a URL with a specific port to AVFoundation and then backgrounds and foregrounds the app
Asked
Active
Viewed 340 times
1 Answers
1
When you create a GCDWebServer instance, you specify a port, so that same port will always be used.
If you pass 0, then a random one is used each time.

Pol
- 3,848
- 1
- 38
- 55
-
is there any port that is very unlikely to be picked by the OS for future apps? if i specify a port and another service is using that port, won't it simply fail? – meisel Feb 03 '16 at 21:57
-
You are correct, it will fail. In practice though, iOS devices are not servers, they don't run services like HTTP, AFP, SSH, FTP... I'm pretty sure all ports are available including lower ones like 80 for typical HTTP. – Pol Feb 04 '16 at 05:10