Quote:
Originally Posted by
aix.rockie
in /etc/services, we have entry for the service
I suppose there are a few misconceptions to clear:
The file
/etc/services is not
actively doing anything. It is a mere directory of ports, like i.e.
/etc/hosts is for IP addresses/host names. Nobody would expect a host to get a "hostname configured" just because it was entered in /etc/hosts and the same is true for
/etc/services.
In fact it is like this: a "port" is a (layer 4 of the OSI reference model) addressing device like the IP address is (the layer 3 addressing device). Behind every port (0-65535) can "wait" a process - or not. Picture an IP-host to be like a large house (the IP address) with lots of apartments (ports). When you ring the bell at a certain apartment (connect to a certain port) maybe someone is at home and answers (there is some process taking packets coming in at that port) or nobody is at home and then nobody answers your ringing.
Common protocols (telnet, ftp, ssh, http, ....) have a certain port where they "usually" answer. This is done by configuring the respective programs (usually "daemons", because they work in background) to bind to the respective port. In principle you can configure any service to use any port, but there are some defaults.
When you "telnet" a host and it answers the following happens: at the start of the IP stack some process (the telnetd daemon) is started at the host which binds to port 23 (per default - maybe configured to use some other port) and then listens to incoming connections at that port. When you now enter "telnet hostname" at some remote host you start a client program which contacts "hostname" at port 23 and from there the telnetd picks it up, establishes a connection (so-called "virtual channel") and at some point this is dissolved again, ending the connection.
The "connection refused" error you get is just an indication that your telnetd does not listen to port 8080. Btw., you usually have TCP, not UDP, as transport protocol for telnet.
I hope this helps.
bakunin