//
// cocos2d::extension::WebSocket::close from 0xd1fb24 to 0xd1fb90 (108 bytes)
//
// 2 xrefs:
// > cocos2d::extension::WebSocket::~WebSocket @ 0xd1fbb0
// > ??> @ 0x71908
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:07:11 +0000
//
__int64 __fastcall cocos2d::extension::WebSocket::close(cocos2d::CCObject **this)
{
__int64 v2; // x0
cocos2d::CCScheduler *v3; // x0
__int64 result; // x0
cocos2d::extension::WsThreadHelper *v5; // x0
v2 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
v3 = (cocos2d::CCScheduler *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 128LL))(v2);
cocos2d::CCScheduler::unscheduleAllForTarget(v3, *(this + 9));
result = (unsigned int)(*((_DWORD *)this + 2) - 2);
if ( (unsigned int)result > 1 )
{
v5 = *(this + 9);
*((_DWORD *)this + 2) = 3;
cocos2d::extension::WsThreadHelper::joinSubThread(v5);
return (*(__int64 (__fastcall **)(_QWORD, cocos2d::CCObject **))(*(_QWORD *)*(this + 12) + 32LL))(
*(this + 12),
this);
}
return result;
}