introduction to sockets and web services localhost (and is used to refer to the computer you are currently on when program is runthat is it is your local host computer (hence the name localhostfor exampleif you start up socket server on your local computer and want client socket programrunning on the same computerto connect to the server programyou can tell it to do so by getting it to connect to localhost this is particularly useful when either you don' know the ip address of your local computer or because the code may be run on multiple different computers each of which will have their own ip address this is particularly common if you are writing test code that will be used by developers when running their own tests on different developer (hostmachines we will be using localhost in the next two as way of specifying where to look for server program port numbers each internet device/host can typically support multiple processes it is therefore necessary to ensure that each process has its own channel of communications to do this each host has available to it multiple ports that program can connect too for example port is often reserved for http web serverswhile port is reserved for smtp servers this means that if client wants to connect to http server on particular computer then it must specify port not port on that host port number is written after the ip address of the host and separated from the address by colonfor examplewww aber ac uk: indicates port on the host machine which will typically be running http serverin this case for aberystwyth university localhost: this indicates that you wish to connect to port which is typically reserved for an imap (internet message access protocolserver on your local machine www uwe ac uk: this indicates port on host running at the university of the west of englandbristol port is usually reserved for smtp (simple mail transfer protocolservers port numbers in the ip system are bit numbers in the range - generallyport numbers below are reserved for pre-defined services (which means that you should avoid using them unless you wish to communicate with one of those services such as telnetsmtp mailftp etc therefore it is typically to choose port number above when setting up your won services