CSocketWrench::GetServicePort Method  
 
UINT GetServicePort(
  LPCTSTR lpszServiceName  
);

The GetServicePort method returns the port number associated with a service name.

Parameters

lpszServiceName
A pointer to a string which specifies the name of the service to return the port number for.

Return Value

If the method succeeds, the return value is the port number associated with a service name. If the method fails, the return value is INET_ERROR. To get extended error information, call GetLastError.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetServiceName