Information about the CICS® servers that can be used by a Client application is defined in the CICS Transaction Gateway configuration file (ctg.ini). The existence of a server definition doesn't guarantee availability of a server.
CclECI* pECI = CclECI::instance();
printf( "Server Count = %d\n", pECI-> serverCount() );
printf( "Server1 Name = %s\n", pECI-> serverName( 1 ) );
…
Typical output produced: Server Count = 2
Server1 Name = DEVTSERV