void InterprocessConnectionServer::run() { while ((! threadShouldExit()) && socket != nullptr) { ScopedPointer<StreamingSocket> clientSocket (socket->waitForNextConnection()); if (clientSocket != nullptr) if (InterprocessConnection* newConnection = createConnectionObject()) newConnection->initialiseWithSocket (clientSocket.release()); } }
PDOConnection *PDODriver::createConnection(CStrRef datasource, CStrRef username, CStrRef password, CArrRef options) { PDOConnection *conn = createConnectionObject(); conn->data_source = string(datasource.data(), datasource.size()); conn->username = string(username.data(), username.size()); conn->password = string(password.data(), password.size()); if (options.exists(PDO_ATTR_AUTOCOMMIT)) { conn->auto_commit = options[PDO_ATTR_AUTOCOMMIT].toInt64(); } else { conn->auto_commit = 1; } if (!conn->create(options)) { delete conn; return NULL; } return conn; }