getservbyport

Socket.getservbyport(port [, protocol_name]) => service
Class Public methods

Obtains the port number for port.

If protocol_name is not given, âtcpâ is assumed.

Socket.getservbyport(80)         #=> "www"
Socket.getservbyport(514, "tcp") #=> "shell"
Socket.getservbyport(514, "udp") #=> "syslog"
doc_ruby_on_rails
2015-05-15 05:30:32
Comments
Leave a Comment

Please login to continue.