nametoport

fnint nametoport(string name, out int port, out int proto)

Resolves a service name to its port number and protocol.

Parameters

nameThe service name (e.g. "http").
portReceives the port number.
protoReceives the protocol number.

Returns

0 on success, -1 if not found.