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

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

Parameters

lpszServiceName
A null-terminated 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 File: cswsock12.h
Import Library: cswskv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also