Пример #1
0
const BootstrapServers& getBootstrapServers() 
{
    static BootstrapServers listOfServers;
    if (listOfServers.empty()) {
        listOfServers.push_back(createTransportInfo(0x929a2016, 0xfb9a3cf0, 1, "AAABJjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALPFnHKu3C/sPCp14y+LDR9pZky19eu4az9SuuvPXrb140akP6dkCstA8MBak9FoihYKf6oIAlmV+kh1We8uvpcMqHPWRSMZfn/1lQxE3wy/gtXwAP1GiMCgIS5UDW/sYRzPEpxKO6kN1hfF9AUaWu5mB7yCR+KTmTVY96WeXMiDbYkd0sBdPDUbT30JHZ4OSf9ZiPiGd8D2SEAe2vPyPdOT6p/w1Gx2HcWZ9CwE/qWSWQcgDGXQ+c8jTW/bPtcQK+UzWiRZAyvRM+WipCXBmqCNzDFLmuRiGFk+Tx+tqeVvI9XdjhicPRuF4GSqdUmmhRxpIWx8IfZbzoZhzILMisMCAwEAAQAAAAlsb2NhbGhvc3QAACah"));
listOfServers.push_back(createTransportInfo(0x929a2016, 0x56c8ff92, 1, "AAABJjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALPFnHKu3C/sPCp14y+LDR9pZky19eu4az9SuuvPXrb140akP6dkCstA8MBak9FoihYKf6oIAlmV+kh1We8uvpcMqHPWRSMZfn/1lQxE3wy/gtXwAP1GiMCgIS5UDW/sYRzPEpxKO6kN1hfF9AUaWu5mB7yCR+KTmTVY96WeXMiDbYkd0sBdPDUbT30JHZ4OSf9ZiPiGd8D2SEAe2vPyPdOT6p/w1Gx2HcWZ9CwE/qWSWQcgDGXQ+c8jTW/bPtcQK+UzWiRZAyvRM+WipCXBmqCNzDFLmuRiGFk+Tx+tqeVvI9XdjhicPRuF4GSqdUmmhRxpIWx8IfZbzoZhzILMisMCAwEAAQAAAAlsb2NhbGhvc3QAACag"));
;
        std::random_shuffle(listOfServers.begin(), listOfServers.end());
    }
    return listOfServers;
}
Пример #2
0
MME_ERROR MME_HostRegisterTransport(const char *name)
#endif
{
	MME_ERROR res;
	EMBX_ERROR err;
	TransportInfo_t *tpInfo = 0;

#ifndef MME_LEAN_AND_MEAN
        if (manager == NULL) {
		MME_Info(MME_INFO_MANAGER, (DEBUG_ERROR_STR "MME not initialized\n"));
                return MME_DRIVER_NOT_INITIALIZED;      /* the manager must exist */
        }

	if (name == NULL) {
		MME_Info(MME_INFO_MANAGER, (DEBUG_ERROR_STR "Name not valid\n"));
		return MME_INVALID_ARGUMENT;
	}
#endif

	EMBX_OS_MUTEX_TAKE(&manager->monitorMutex);	

#ifndef MME_LEAN_AND_MEAN
	/* prevent duplicate transport registrations */
	for (tpInfo = manager->transportList; tpInfo; tpInfo = tpInfo->next) {
		EMBX_TPINFO embxTpInfo;

		err = EMBX_GetTransportInfo(tpInfo->handle, &embxTpInfo);
		MME_Assert(EMBX_SUCCESS == err);

		if (0 == strcmp(name, embxTpInfo.name)) {
			EMBX_OS_MUTEX_RELEASE(&manager->monitorMutex);
			MME_Info(MME_INFO_MANAGER, (DEBUG_ERROR_STR "Transport already registered\n"));
			return MME_INVALID_ARGUMENT;
		}
	}
#endif

	/* allocate space for the transport descriptor */
	res = createTransportInfo(name, &tpInfo);
	if (MME_SUCCESS == res) {
		/* update the lists with in the manager */
		tpInfo->next = manager->transportList;
		manager->transportList = tpInfo;
	}

	EMBX_OS_MUTEX_RELEASE(&manager->monitorMutex);
       	MME_Info(MME_INFO_MANAGER, (DEBUG_NOTIFY_STR "<<<< (%d)\n", res));
	return res;
}