I want to develop an enterprise application wherein each employee has a client application and there is a common server which has the server application. The client and server are basically exchanging information in the form of text, image files, zip files, etc. From my research I think TCP is the best protocol. But I do not understand how to assign port numbers. Here is what my understanding is so far.
- Client can have any random port selected automatically by OS. So I just need to query with OS for getting port number for client?
- Server port number has to be hard coded in server and client application.
- Server port number should always be 80. Why? Is it possible to have any other port number for server application? If yes how do I select it?
- What happens if the port number used by server is already being used by some other application on the server?
EDIT: Following are some of the articles/questions which gave me an impression that port 80 is the default port for the server.