newntui/discovermdi/src/servicechooser.cpp
//--------------------------------------------------------------------------------
// This function will ask nameserver for all available pset servers.
//--------------------------------------------------------------------------------
This function will ask nameserver for all available pset servers.
This function will ask nameserver for all available pset servers .
void CServiceChooser::FillServiceList() {
NameServerServiceList* services;
CString name;
const char* strPtr;
char host[1024];
CString templ;
	gethostname(host,1024);
    templ="Discover:";
	templ+=host;
    templ+=":";
    m_ServiceList.ResetContent();
    NameServerGetListOfServices(&services);
	NameServerServiceList* pTemp = services;
	while(pTemp!=NULL) {
		strPtr = pTemp->getName();
		if(strPtr!=NULL) {
			name=strPtr;
			if(name.Find(templ)==0)        
				 m_ServiceList.AddString(name);
		}
		pTemp=pTemp->getNext();
	}
	delete services;
}
void CServiceChooser :: FillServiceList ( ) { NameServerServiceList * services ; CString name ; const char * strPtr ; char host [ 1024 ] ; CString templ ; gethostname ( host , 1024 ) ; templ = " " ; templ += host ; templ += " " ; m_ServiceList . ResetContent ( ) ; NameServerGetListOfServices ( & services ) ; NameServerServiceList * pTemp = services ; while ( pTemp != NULL ) { strPtr = pTemp -> getName ( ) ; if ( strPtr != NULL ) { name = strPtr ; if ( name . Find ( templ ) == 0 ) m_ServiceList . AddString ( name ) ; } pTemp = pTemp -> getNext ( ) ; } delete services ; }
This function will ask nameserver for all available pset servers.
This function will ask nameserver for all available pset servers .
// All valid services must start as "Discover:<host>"