mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
Socket waits now block in select() on the socket plus a wake or cancel socket (Common/Net/Cancel), so a stop or cancel ends them at once. - HTTP: cancel flags become net::CancelToken; Connect waits once on all addresses, receives wait instead of spinning, no DNS retry sleep. - Adhoc: the friend finder and adhoc server block on their sockets with a wake socket and a deadline; matching runs on a CoreTiming tick instead of two threads (savestate section bumped). - sceNetInet select/poll check without blocking and park the HLE thread, re-checked from a CoreTiming event until ready or the emulated timeout. - Vendor the aemu_postoffice client (was a submodule) with no sleeps: waits on the socket, close via shutdown and an eventcount, cancelable connects, and lock-free session slot claims. - PortManager waits without a timeout; PSP_InitWait replaces the headless boot poll. - TimeUtil: sleep_us/sleep_ms only outside the core; sleep_precise, sleep_random, yield and the Windows timer period are gone. - Unit test for the socket waits.
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
// Copyright (c) 2025- PPSSPP Project.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
// Official git repository and contact information can be found at
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
#pragma once
|
|
|
|
#include "Core/HLE/proAdhoc.h"
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma pack(push,1)
|
|
#endif
|
|
typedef struct MatchingArgs {
|
|
u32_le data[6]; // ContextID, EventID, bufAddr[ to MAC], OptLen, OptAddr[, EntryPoint]
|
|
} PACK MatchingArgs;
|
|
#ifdef _MSC_VER
|
|
#pragma pack(pop)
|
|
#endif
|
|
|
|
class PointerWrap;
|
|
|
|
int NetAdhocMatching_Term();
|
|
|
|
void DoNetAdhocMatchingInited(PointerWrap &p);
|
|
void DoNetAdhocMatchingThreads(PointerWrap &p);
|
|
// present: the state has the tick's event id (sceNetAdhoc section 10 and up).
|
|
void DoNetAdhocMatchingTick(PointerWrap &p, bool present);
|
|
void ZeroNetAdhocMatchingThreads();
|
|
void SaveNetAdhocMatchingInited();
|
|
void RestoreNetAdhocMatchingInited();
|
|
|
|
void Register_sceNetAdhocMatching();
|
|
void __NetAdhocMatchingInit();
|
|
void __NetAdhocMatchingShutdown();
|
|
|
|
extern bool netAdhocMatchingInited;
|
|
extern int adhocMatchingEventDelay; //30000
|