Function SocketGetServByName() Professional

Retrieves internet service information from a service name and protocol.

SocketGetServByName( <cServiceName>  , ;
                     [<cProtocolName>] ) --> aServiceInfo|NIL
A character string containing the name of the internet service.
A character string containing the name of a protocol. If this parameter is omitted, information of the first internet service is returned where <cServiceName> matches the name of the service or one of its alias names.

The function returns an array containing service information, or NIL on failure. The following #define constants are available in the file SOCKET.CH to access the individual elements of the service array:

Constants for the service array
Constant Description
SERVINFO_ALIAS One-dimensional array holding character strings with the alias names of a service.
SERVINFO_CNAME The service name as character string
SERVINFO_CPROT The name of the underlying protocol used for the service.
SERVINFO_NPORT The port number at which the service is available in network byte order.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.