getservbyname

Socket.getservbyname(service_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
doc_ruby_on_rails
2015-05-15 05:28:43
Comments
Leave a Comment

Please login to continue.