Question

I'm trying to make a file sharing app. One solution that I came up with is using an embedded mini HTTP server to allow others to connect to my app (and serve content to them). Now, I wonder, what if, the user already has an app that uses this technique, and already has the port 80 busy listening for incoming connections. When I'll try to start my server, it will fail, won't it? Can I avoid this situation?

Était-ce utile?

La solution

80 tcp port well known as HTTP, best way to avoid this problem is select some non popular port after 1024 to your app

Autres conseils

Assuming that you run your mini web server in your iPhone and your user is in another iPhone or a PC, they will connect to you based on your IP or bonjour address. The HTTP traffic will use port 80 by default so if you are not using http you will probably want another port other than 80. The webdav apps for iPhone typically use 8080. Regarding your question - if they have a web server app in their iPhone installed - it does not matter even if they are using the same port, the server runs on your iPhone not theirs.

I do not think that the iPhone can operate more than 1 wen server at a time, I understand new virtualisation technology allows multiple web servers running in a common server with a common IP, Far as I know the webdav apps that I have cannot run concurrently.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top