Socket.getservbyname(service_name) => port_number
Socket.getservbyname(service_name, protocol_name) => port_number
Socket.getservbyname(service_name, protocol_name) => port_number
Class Public methods
Obtains the port number for service_name.
If protocol_name is not given, âtcpâ is assumed.
Socket.getservbyname("smtp") #=> 25 Socket.getservbyname("shell") #=> 514 Socket.getservbyname("syslog", "udp") #=> 514
Please login to continue.