Service

Class for retrieving service information.

Members

Functions

getServiceByName
bool getServiceByName(const(char)[] name, const(char)[] protocolName)
getServiceByPort
bool getServiceByPort(ushort port, const(char)[] protocolName)

If a protocol name is omitted, any protocol will be matched.

Variables

aliases
string[] aliases;

These members are populated when one of the following functions are called successfully:

name
string name;
port
ushort port;
protocolName
string protocolName;

These members are populated when one of the following functions are called successfully:

Examples

auto serv = new Service;
writeln("About service epmap:");
if (serv.getServiceByName("epmap", "tcp"))
{
    writefln("  Service: %s", serv.name);
    writefln("  Port: %d", serv.port);
    writefln("  Protocol: %s", serv.protocolName);
    foreach (string s; serv.aliases)
         writefln("  Alias: %s", s);
}
else
    writefln("  No service for epmap.");

Meta