void FSFloaterNearbyChat::onOpen(const LLSD& key ) { FSFloaterIMContainer* floater_container = FSFloaterIMContainer::getInstance(); if (floater_container) { if (gSavedSettings.getBOOL("ChatHistoryTornOff")) { // first set the tear-off host to this floater setHost(floater_container); // clear the tear-off host right after, the "last host used" will still stick setHost(NULL); // reparent the floater to the main view gFloaterView->addChild(this); } else { floater_container->addFloater(this, FALSE); } } // We override this to put nearbychat in the IM floater. -AO if(isChatMultiTab() && ! isVisible(this)) { // only show the floater container if we are actually attached -Zi if (floater_container && !gSavedSettings.getBOOL("ChatHistoryTornOff")) { // make sure to show our parent floater, too floater_container->setVisible(TRUE); floater_container->showFloater(this, LLTabContainer::START); } setVisible(TRUE); } LLFloater::onOpen(key); }
void ItalcVncConnection::reset( const QString &host ) { if( m_state != Connected && isRunning() ) { setHost( host ); } else { stop(); setHost( host ); start(); } }
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext): HTTPClientSession(SecureStreamSocket(pContext)), _pContext(pContext) { setHost(host); setPort(port); }
int SimpleRedisClient::redis_conect(const char* Host,int Port, int TimeOut) { setPort(Port); setHost(Host); setTimeout(TimeOut); return redis_conect(); }
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port): HTTPClientSession(SecureStreamSocket()), _pContext(SSLManager::instance().defaultClientContext()) { setHost(host); setPort(port); }
void SimpleHttp::download(const QString & url) { qDebug("SimpleHttp::download: %s", url.toLatin1().constData()); downloaded_text.clear(); QUrl u(url); setHost( u.host() ); /* qDebug("u.path: %s", u.path().toLatin1().constData()); qDebug("u.query: %s", u.encodedQuery().constData()); */ QString p = u.path(); if (!u.encodedQuery().isEmpty()) p += "?" + u.encodedQuery(); if (user_agent.isEmpty()) { http_get_id = get( p ); } else { QHttpRequestHeader header("GET", p); header.setValue("Host", u.host()); header.setValue("User-Agent", user_agent); http_get_id = request(header); } emit connecting(u.host()); }
void HttpRequest::setUrl(const HttpUrl &url) { m_rawurl = url.getPath(); m_extra = url.getParams(); setHost(url.getHost()); setPort(url.getPort()); }
// Parameter-Konstruktor CDatabase_Connection::CDatabase_Connection(string user, string password, string DB, string Host, int Port) { try { mysql_init(&my); LoadDefaults(); setUsername(user); setPassword(password); setDB(DB); setHost(Host); setPort(Port); this->connected = false; this->initialised = false; } catch(...) { cerr << "An unexpected error occured in function 'Default-Constructor'!" << endl; } }
bool EClientSocket::eConnect( const char *host, unsigned int port, int clientId, bool extraAuth) { if( m_fd == -2) { getWrapper()->error( NO_VALID_ID, FAIL_CREATE_SOCK.code(), FAIL_CREATE_SOCK.msg()); return false; } // reset errno errno = 0; // already connected? if( m_fd >= 0) { errno = EISCONN; getWrapper()->error( NO_VALID_ID, ALREADY_CONNECTED.code(), ALREADY_CONNECTED.msg()); return false; } // normalize host m_hostNorm = (host && *host) ? host : "127.0.0.1"; // initialize host and port setHost( m_hostNorm); setPort( port); // try to connect to specified host and port ConnState resState = CS_DISCONNECTED; return eConnectImpl( clientId, extraAuth, &resState); }
void Chatbox::parseString(QString str) { if (str[0] != '!') { emit message(str); return; } str[0] = ' '; str = str.trimmed().toLower(); QStringList list = str.split(QRegExp("\\s+")); QStringList::const_iterator it = list.begin(); if (it->contains(rgxPos)) { emit playStone(Position(*it)); } else if (*it == "pass" || *it == "p") { emit pass(); } else if (*it == "undo" || *it == "u") { emit undo(); } else if (*it == "kill" || *it == "k") { if (++it == list.end() || !it->contains(rgxPos)) display("Expected position as second argument."); else emit kill(Position(*it)); } else if (*it == "exit" || *it == "e") { emit exit(); } else if (*it == "connect" || *it == "c") { if (++it != list.end()) { emit setHost(*it); if (++it != list.end()) { emit setPort(it->toInt()); } } emit cl_connect(); } else if (*it == "disconnect" || *it == "dc") { emit cl_disconnect(); } else if (*it == "yes" || *it == "y") { emit confirm(true); } else if (*it == "no" || *it == "n") { emit confirm(false); } else if (*it == "save" || *it == "s") { if (++it == list.end()) display("Expected filename as second argument."); else emit writeLogToDisk(*it); } else if (*it == "help" || *it == "h" ) { display("4DGo -- A four-dimensional goban for online play."); display("All commands start with a '!'. Any input that does not is treated as a chat message. All comands are case-insensitive."); display(" Commands:"); display("!connect [hostname] [port]: connect to the game server. By default, localhost:15493 will be used."); display("!disconnect: break connection to server and clear the goban."); display("!A4d4: on slice A4 (top-left), on intersection d4 (top-right)."); display("!pass: end your turn without playing a stone."); display("!undo: request that your last move be undone."); display("!yes: allow the action your opponent requested (usually an undo or kill)."); display("!yes: refuse to allow the action your opponent requested (usually an undo or kill)."); display("!kill: request a certain group to be immediately taken off the board. Useful in endgame, to not need to play out all captures."); display("!save filename: save the current history to file filename."); display("!exit: disconnect and close the window."); } else { tbCBox_->append(QString("Unknown command: ")+*it); } }
void Communicator::init() { m_http = new QHttp(this); m_userAgent = strUserAgent; // Lib version setHost(strLJHost, 80); setPath(strInterfacePath); connect(m_http, SIGNAL(requestFinished(int, bool)), SLOT(requestFinished(int, bool))); }
bool HttpRequester::open(const string& host) { boost::asio::io_service io_service; _connection = new HttpConnection<HttpRequester>(io_service, *this); setHost(host); return _connection->connect(_host); }
void NetworkAccount::readConfig(/*const*/ KConfig/*Base*/ & config) { KMAccount::readConfig(config); setLogin(config.readEntry("login")); if(config.readNumEntry("store-passwd", false)) // ### s/Num/Bool/ { mStorePasswd = true; QString encpasswd = config.readEntry("pass"); if(encpasswd.isEmpty()) { encpasswd = config.readEntry("passwd"); if(!encpasswd.isEmpty()) encpasswd = importPassword(encpasswd); } if(!encpasswd.isEmpty()) { setPasswd(decryptStr(encpasswd), true); // migrate to KWallet if available if(Wallet::isEnabled()) { config.deleteEntry("pass"); config.deleteEntry("passwd"); mPasswdDirty = true; mStorePasswdInConfig = false; } else { mPasswdDirty = false; // set by setPasswd() on first read mStorePasswdInConfig = true; } } else { // read password if wallet is already open, otherwise defer to on-demand loading if(Wallet::isOpen(Wallet::NetworkWallet())) readPassword(); } } else { setPasswd("", false); } setHost(config.readEntry("host")); unsigned int port = config.readUnsignedNumEntry("port", defaultPort()); if(port > USHRT_MAX) port = defaultPort(); setPort(port); setAuth(config.readEntry("auth", "*")); setUseSSL(config.readBoolEntry("use-ssl", false)); setUseTLS(config.readBoolEntry("use-tls", false)); mSieveConfig.readConfig(config); }
void DatabaseLogin::copy(DatabaseLogin const &oSource) { setUser(oSource.getUser()); setPassword(oSource.getPassword()); setDatabase(oSource.getDatabase()); setHost(oSource.getHost()); setPort(oSource.getPort()); saveHost(oSource.requiresSaveHost()); }
void DatabaseLogin::clear(void) { setUser(""); setPassword(""); setDatabase(""); setHost(""); setPort(-1); saveHost(false); }
SurfaceComponent::~SurfaceComponent() { setHost (0); deleteAndZero (editor); deleteAndZero (internal); deleteAndZero (properties); deleteAndZero (horizontalDividerBar); }
Address::Address(const char *const host, const unsigned short port) : m_valid(true) { memset(&m_addr, 0, sizeof(m_addr)); m_addr.sin_family = AF_INET; setHost(host); setPort(port); }
IPv4Address::IPv4Address() : data(new InternalIPv4AddressData_t) { #ifdef UTIL_HAVE_LIB_SDL2_NET setHost(0); setPort(0); #elif defined(__linux__) || defined(__unix__) || defined(ANDROID) memset(&(data->address), 0, sizeof(sockaddr_in)); #endif }
void Request::setHost(const std::string& host, UInt16 port) { std::string value(host); if (port != 80 && port != 443) { value.append(":"); value.append(util::itostr<UInt16>(port)); } setHost(value); }
QURequestUrl::QURequestUrl(const QString &host, const QStringList &properties, QUSongInterface *song): QUrl() { _song = song; _properties = properties; // setup this URL instance setScheme("http"); setHost(host); setQueryDelimiters('=', '&'); }
void CatanRoom::RemovePlayer( CatanPlayer *player ) { disconnect( player, SIGNAL(requestLeaveRoom()), this, SLOT(onPlayerLeave())); disconnect( player, SIGNAL(destroyed()), this, SLOT(onPlayerDestroying())); if( players[player->GetID()] != player ) return; LOG_DEBUG("[Lobby " << GetID() << "] Removing player: " << player->GetName() << endl); //remove the player players[player->GetID()] = 0; readyPlayers[player->GetID()] = false; playerCount--; cancelStartup(player); emit removedPlayer(player); //remove this room if it is empty if( GetNumPlayers() == 0 ) { player->deleteLater(); this->deleteLater(); return; } //get a list of all the players to send the message to QVector<CatanPlayer*> playerList = getPlayers(); if( player == host ) //if this was the host { //remove the previous host disconnect( player, SIGNAL(requestStartGame()), this, SLOT(requestStartGame())); disconnect( player, SIGNAL(requestChangeConfig(QDataStream&)), this, SLOT(receivedChangeConfig(QDataStream&))); host = 0; //set the host to the next player in the list LOG_INFO("The host disconnected from lobby [" << (quint16)GetID() << "]" << endl); for( int i = 0; i < GetMaxPlayers(); i++ ) { if( players[i] ) { setHost(players[i]); break; } } if( host ) { LOG_DEBUG("New lobby host: " << host->GetName() << endl); net::Begin(NETWORK_COMMAND::SERVER_ROOM_NEW_HOST); net::AddByte(host->GetID()); net::Send(playerList); } }
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession): HTTPClientSession(SecureStreamSocket(pContext, pSession)), _pContext(pContext), _pSession(pSession) { setHost(host); setPort(port); SecureStreamSocket sss(socket()); sss.setPeerHostName(host); }
void DefaultGdbServerProviderConfigWidget::applyImpl() { auto p = static_cast<DefaultGdbServerProvider *>(provider()); Q_ASSERT(p); p->setHost(m_hostWidget->host()); p->setPort(m_hostWidget->port()); p->setInitCommands(m_initCommandsTextEdit->toPlainText()); p->setResetCommands(m_resetCommandsTextEdit->toPlainText()); }
void AddressManager::setDomainInfo(const QString& hostname, quint16 port, LookupTrigger trigger) { setHost(hostname, trigger); _rootPlaceID = QUuid(); qCDebug(networking) << "Possible domain change required to connect to domain at" << hostname << "on" << port; DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::HandleAddress); emit possibleDomainChangeRequired(hostname, port); }
bool KInetSocketAddress::setAddress(const sockaddr_in *sin, ksocklen_t len) { // This is supposed to be a AF_INET socket if((len < sizeof(sockaddr_in)) || (sin->sin_family != AF_INET)) { kdWarning() << "KInetSocketAddress::setAddress(sockaddr_in*) called with invalid sockaddr_in\n"; return false; } return setHost(sin->sin_addr) && setPort(ntohs(sin->sin_port)); }
void HTTPRequest::setHost(const std::string& host, uint16_t port) { std::string value; value.append(host); if (port != 80 && port != 443) { value.append(":"); NumberFormatter::append(value, port); } setHost(value); }
void CIMObjectPath::set( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array<CIMKeyBinding>& keyBindings) { setHost(host); setNameSpace(nameSpace); setClassName(className); setKeyBindings(keyBindings); }
void SpecialConfigRequest::performDnsRequest() { auto dnsUrl = QUrl(); dnsUrl.setScheme(qsl("https")); dnsUrl.setHost(qsl("google.com")); dnsUrl.setPath(qsl("/resolve")); dnsUrl.setQuery(qsl("name=%1.stel.com&type=16").arg(cTestMode() ? qsl("tap") : qsl("ap"))); auto dnsRequest = QNetworkRequest(QUrl(dnsUrl)); dnsRequest.setRawHeader("Host", "dns.google.com"); _dnsReply.reset(_manager.get(dnsRequest)); connect(_dnsReply.get(), &QNetworkReply::finished, this, [this] { dnsFinished(); }); }
Connection::Connection(NetworkDomain* d, Connection* n, const char* h, int p, struct sockaddr_in s,bool r) { setHost(h); port = p; sin = s; reachable = r; domain = d; next = n; }
TimedTcpConnection::TimedTcpConnection(TcpConnection *tcpConnection, const unsigned long timeOutSec) : StreamConnection("invalid", "invalid") , TimerUser() , m_tcpConnection(tcpConnection) , m_timeOutSec(timeOutSec) { TRACE; setHost(m_tcpConnection->getHost()); setPort(m_tcpConnection->getPort()); }