// Work //------------------------------------------------------------------------------ int Worker::Work() { // start listening if ( m_ConnectionPool->Listen( Protocol::PROTOCOL_PORT ) == false ) { ShowMessageBox( "Failed to listen on port %u. Check port is not in use.", Protocol::PROTOCOL_PORT ); return -1; } // Special folder for Orbis Clang // We just create this folder whether it's needed or not { AStackString<> tmpPath; VERIFY( FileIO::GetTempDir( tmpPath ) ); #if defined( __WINDOWS__ ) tmpPath += ".fbuild.tmp\\target\\include"; #else tmpPath += "_fbuild.tmp/target/include"; #endif if ( !FileIO::EnsurePathExists( tmpPath ) ) { ShowMessageBox( "Failed to initialize tmp folder. Error: 0x%x", Env::GetLastErr() ); return -2; } #if defined( __WINDOWS__ ) tmpPath += "\\.lock"; #else tmpPath += "/_lock"; #endif if ( !m_TargetIncludeFolderLock.Open( tmpPath.Get(), FileStream::WRITE_ONLY ) ) { ShowMessageBox( "Failed to lock tmp folder. Error: 0x%x", Env::GetLastErr() ); return -2; } } while ( WorkerWindow::Get().WantToQuit() == false ) { UpdateAvailability(); UpdateUI(); CheckForExeUpdate(); PROFILE_SYNCHRONIZE Thread::Sleep( 100 ); } // allow to UI to shutdown // the application MUST NOT try to update the UI from this point on m_MainWindow->SetAllowQuit(); m_WorkerBrokerage.SetAvailability( false ); return 0; }
BOOL LinkOptions::OnInitDialog() { char timeout[6]; CDialog::OnInitDialog(); AddMode("Nothing (Disconnect)", LINK_DISCONNECTED); AddMode("Cable - Single Computer", LINK_CABLE_IPC); AddMode("Cable - Network", LINK_CABLE_SOCKET); AddMode("GameCube - Dolphin", LINK_GAMECUBE_DOLPHIN); AddMode("Wireless adapter - Single Computer", LINK_RFU_IPC); AddMode("Wireless adapter - Network", LINK_RFU_SOCKET); AddMode("Game Link (Game Boy) - Single Computer", LINK_GAMEBOY_IPC); AddMode("Game Link (Game Boy) - Network", LINK_GAMEBOY_SOCKET); sprintf(timeout, "%d", linkTimeout); m_timeout.LimitText(5); m_timeout.SetWindowText(timeout); m_serverip.SetWindowText(theApp.linkHostAddr); CheckDlgButton(IDC_AUTOLINK, linkAuto); CheckDlgButton(IDC_SSPEED, linkHacks); int player_radio = 0; switch (linkNumPlayers) { case 2: player_radio = IDC_LINK2P; case 3: player_radio = IDC_LINK3P; case 4: player_radio = IDC_LINK4P; default: player_radio = IDC_LINK2P; } CButton* pButton = (CButton*)GetDlgItem(player_radio); pButton->SetCheck(true); UpdateAvailability(); UpdateData(FALSE); return TRUE; }
BOOL LinkOptions::OnInitDialog(){ char timeout[6]; CDialog::OnInitDialog(); AddMode("Nothing (Disconnect)", LINK_DISCONNECTED); AddMode("Cable - Single Computer", LINK_CABLE_IPC); AddMode("Cable - Network", LINK_CABLE_SOCKET); AddMode("GameCube - Dolphin", LINK_GAMECUBE_DOLPHIN); AddMode("Wireless adapter - Single Computer", LINK_RFU_IPC); sprintf(timeout, "%d", theApp.linkTimeout); m_timeout.LimitText(5); m_timeout.SetWindowText(timeout); m_serverip.SetWindowText(theApp.linkHost); UpdateAvailability(); UpdateData(FALSE); return TRUE; }
// ---------------------------------------------------------------------------- // QBtServiceAdvertiserPrivate::StartAdvertiser(const QBtService& service) // // start service advertiser on given channel. an entry to service discovery // database will be entered describing our advertised service. // ---------------------------------------------------------------------------- void QBtServiceAdvertiserPrivate::StartAdvertiser (const QBtService& service) { //localService = new QBtService(service); // open sdp session User::LeaveIfError(iSdp.Connect()); // open sdp database session User::LeaveIfError(iSdpDB.Open(iSdp)); // create a record of the correct service class //QBtUuid uuid = service.getClass(); TUUID uuid = QBtUuidToSymbianUuid (service.getClass() ); iSdpDB.CreateServiceRecordL (uuid, iRecord); // add a protocol to the record CSdpAttrValueDES* protocolDescriptorList = CSdpAttrValueDES::NewDESL(NULL); CleanupStack::PushL(protocolDescriptorList); TBuf8<1> channel; channel.Append((TChar)service.getPort()); // create protocol list for our service MSdpElementBuilder* e = protocolDescriptorList->StartListL(); QBtService::ProtocolList protocolList = service.getProtocols(); for (int i=0; i < protocolList.size(); i++) { e = e->BuildDESL(); e = e->StartListL(); TUUID u = QBtUuidToSymbianUuid (protocolList[i]); e = e->BuildUUIDL (u); if (u == TUUID (KRFCOMM) ) e = e->BuildUintL(channel); e = e->EndListL(); } e->EndListL(); // set protocol list to the record iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdProtocolDescriptorList, *protocolDescriptorList); CleanupStack::PopAndDestroy(protocolDescriptorList); // add a name to the record TPtrC16 servName(service.getName().utf16()); iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceName, servName); // add a description to the record TPtrC16 servDescr(service.getDescription().utf16()); iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceDescription, servDescr); // set service available UpdateAvailability(ETrue); // notify QT_TRYCATCH_LEAVING (emit p_ptr->advertisingStarted(service) ); }
void LinkOptions::OnBnClickedLinkClient() { UpdateData(TRUE); UpdateAvailability(); }
void LinkOptions::OnCbnSelchangeLinkMode() { UpdateData(TRUE); UpdateAvailability(); }