//
// sub_18010A250 from 0x18010a250 to 0x18010a2f5 (165 bytes)
//
// 8 xrefs:
// > sub_1800B7760 @ 0x1800b779f
// > sub_1800B7760 @ 0x1800b77ef
// > sub_1800B7820 @ 0x1800b78a3
// > sub_1800B7820 @ 0x1800b78f0
// > sub_1801125B0 @ 0x1801125f3
// > sub_1801125B0 @ 0x18011272b
// > sub_1801125B0 @ 0x180112833
// > ??> @ 0x1802017a8
//
// This function is hookable on this platform (idp: pc, 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 10:54:32 +0000
//
__int64 __fastcall sub_18010A250(SOCKET s, char *buf, int len, _DWORD *a4)
{
int v8; // eax
int Error; // eax
*a4 = 0;
while ( len )
{
v8 = recv(s, buf, len, 0);
if ( v8 == -1 )
{
Error = WSAGetLastError();
if ( Error == 10035 )
return 45;
if ( Error != 10054 && Error != 10004 )
return 43;
return 16;
}
if ( !v8 )
return 16;
*a4 += v8;
len -= v8;
buf += v8;
}
return 0;
}