Function SocketGetServByPort() Professional
Retrieves service information from a port number and protocol.
Syntax
SocketGetServByPort( <nPort> , ;
[<cProtocolName>] ) --> aServiceInfo|NIL
Parameters
<nPort>
This is the port number in network byte order at which the service is available.
<cProtocolName>
A character string containaing a protocol name can be specified optionally. If this parameter is omitted, the function returns information about the first service where the port number matches.
Return
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. |
Feedback
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.