Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %SS_GETSERVBYPORT(port, [type], service, protocol)
If successful, returns SS_SUCCESS (0) one of the errors in Error codes returned by %SS_GETSERVBYPORT below. (n)
The port number for which to return a service name. (n)
(optional) One of the following types of protocols to access the service: (a)
tcp = Transmission control protocol.
udp = User datagram protocol.
Returned with the name of the service on the specified port. (a)
Returned with the name of the network protocol on the specified port. (a)
%SS_GETSERVBYPORT gets the service name and network protocol from the services file for the specified port number (and optional protocol type). This file is the TCP/IP services file on Windows; the /etc/services file on UNIX; and sys$system:tcpip$services.dat on OpenVMS. (On OpenVMS, this is not a text file that you can edit directly as is the case on Windows and UNIX; rather it’s a binary file, which can be edited with sys$manager:tcpip$config.com.)
If type is not specified, the first match is returned, and protocol will be either “tcp” or “udp.”
If SS_ENULL is returned, the system error code can be returned by immediately calling %SYSERR.
See the Socket Errors table for additional information about these errors.
The example below returns the service name and protocol for port 5555.
status = %ss_getservbyport(5555, tcp, name, proto)