bool CMsnContactManager::GetMessage(const CMsnTicket& ticket) { acl::http_client client; acl::string addr(MSN_CONTACT_SERVER); // 连接 MSN SSO 服务器(ssl 方式) addr << ":443"; if (client.open(addr.c_str()) == false) return (false); // 获得联系人列表 if (GetContacts(ticket, client) == false) return (false); // 关闭连接 client.get_stream().close(); // 再次打开连接 addr << ":443"; if (client.open(addr.c_str(), true) == false) return (false); // 获得地址薄列表 if (GetAddresses(ticket, client) == false) return (false); // 创建用户列表 CreateUsers(); return (true); }
status InitClient(char *host,char *port) { signal(SIGINT,intHandler); signal(SIGPIPE,sigpipeHandler); signal(SIGCHLD,childHandler); /* Cliente por default, sin privilegios */ strcpy(log_user, "anonimo"); strcpy(log_passwd, "anonimo"); FILE * config; address_array_t address; /* Abrir archivo de configuracion */ if((config = fopen(SERVER_CONFIG, "r+")) == NULL) { fprintf(stderr, "No se pudo abrir el archivo de configuracion.\n"); return FATAL_ERROR; } /* Obtener ips y puertos del archivo de configuracion */ if(!GetAddresses(config, &address) || address.count != 2) { fprintf(stderr, "Archivo de configuracion invalido o corrupto\n"); return FATAL_ERROR; } if( host != NULL ) { strcpy(client_host, host); } else strcpy(client_host, address.addresses[1].ip); if( port != NULL ) { strcpy(client_port, port); } else strcpy(client_port, address.addresses[1].port); strcpy(server_host,address.addresses[0].ip ); strcpy(server_port,address.addresses[0].port ); mainProcess_pid=getpid(); return OK; }
/** * Compares this {@code LinkProperties} interface name against the target * * @param target LinkProperties to compare. * @return {@code TRUE} if both are identical, {@code FALSE} otherwise. */ ECode CLinkProperties::IsIdenticalAddresses( /* [in] */ ILinkProperties* target, /* [out] */ Boolean* result) { VALIDATE_NOT_NULL(result); *result = FALSE; VALIDATE_NOT_NULL(target); AutoPtr<IObjectContainer> targetAddr; target->GetAddresses((IObjectContainer**)&targetAddr); AutoPtr<IObjectContainer> sourceAddr; GetAddresses((IObjectContainer**)&sourceAddr); Int32 targetSize, sourceSize; targetAddr->GetObjectCount(&targetSize); sourceAddr->GetObjectCount(&sourceSize); if (targetSize == sourceSize) { sourceAddr->ContainsAll(targetAddr, result); } return NOERROR; }
bool Route::XMLStore(XNode *pRoutesNode, int iOptions) { XNode *pNode = pRoutesNode->AppendChild(_T("Route")); pNode->AppendAttr(_T("Name"), domain_name_); pNode->AppendAttr(_T("Description"), description_); pNode->AppendAttr(_T("TargetHost"), target_smtphost_); pNode->AppendAttr(_T("TargetPort"), StringParser::IntToString(target_smtpport_)); pNode->AppendAttr(_T("NumberOfTries"), StringParser::IntToString(number_of_tries_)); pNode->AppendAttr(_T("MinutesBetweenTry"), StringParser::IntToString(minutes_between_try_)); pNode->AppendAttr(_T("ToAllAddresses"), to_all_addresses_ ? _T("1") : _T("0")); pNode->AppendAttr(_T("RequiresAuthentication"), relayer_requires_authentication_ ? _T("1") : _T("0")); pNode->AppendAttr(_T("Username"), relayer_auth_username_); pNode->AppendAttr(_T("Password"), Crypt::Instance()->EnCrypt(relayer_auth_password_, Crypt::ETBlowFish)); pNode->AppendAttr(_T("TreatRecipientAsLocalDomain"), treat_recipient_as_local_domain_ ? _T("1") : _T("0")); pNode->AppendAttr(_T("TreatSenderAsLocalDomain"), treat_sender_as_local_domain_ ? _T("1") : _T("0")); pNode->AppendAttr(_T("ConnectionSecurity"), StringParser::IntToString(connection_security_)); return GetAddresses()->XMLStore(pNode, iOptions); }
void AddressesModelManager::SaveSettings () const { BSM_->setProperty ("ListenAddresses", QVariant::fromValue (GetAddresses ())); }
Message::Address_t Message::GetAddress (Message::Address a) const { return GetAddresses (a).value (0); }
bool Route::XMLLoadSubItems(XNode *pNode, int iOptions) { return GetAddresses()->XMLLoad(pNode, iOptions); }