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.

1
2
3
Socket.getservbyport(80)         #=> "www"
Socket.getservbyport(514, "tcp") #=> "shell"
Socket.getservbyport(514, "udp") #=> "syslog"
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.