Skip to content

Commit

Permalink
paddrlen
Browse files Browse the repository at this point in the history
  • Loading branch information
red-prig committed Nov 8, 2023
1 parent 73e8b0c commit e255da8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ps4_libscenet.pas
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ function ps4_sceNetAccept(s:Integer;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
if (paddrlen<>nil) then
begin
paddrlen^:=SizeOf(SceNetSockaddr);
end;
end;

function ps4_sceNetRecv(s:Integer;
Expand Down Expand Up @@ -318,6 +322,10 @@ function ps4_sceNetRecvfrom(s:Integer;
begin
Writeln('sceNetRecvfrom:',flags);
Result:=0;
if (paddrlen<>nil) then
begin
paddrlen^:=SizeOf(SceNetSockaddr);
end;
end;

function ps4_sceNetShutdown(s:Integer;how:Integer):Integer; SysV_ABI_CDecl;
Expand All @@ -334,6 +342,10 @@ function ps4_sceNetSocketClose(s:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceNetGetsockname(s:Integer; addr:pSceNetSockaddr; paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
if (paddrlen<>nil) then
begin
paddrlen^:=SizeOf(SceNetSockaddr);
end;
end;

function ps4_sceNetNtohl(net32:DWORD):DWORD; SysV_ABI_CDecl;
Expand All @@ -351,9 +363,20 @@ function ps4_sceNetEpollControl(eid:Integer; op:Integer; id:Integer; event:pSceN
Result:=0;
end;

const
SCE_NET_SO_SNDBUF=$1001;
SCE_NET_SO_RCVBUF=$1002;

function ps4_sceNetGetsockopt(s:Integer; level:Integer; optname:Integer; optval:Pointer; optlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;

if (optval<>nil) then
case optname of
SCE_NET_SO_SNDBUF:PInteger(optval)^:=32768;
SCE_NET_SO_RCVBUF:PInteger(optval)^:=65536;
else;
end;
end;

function ps4_sceNetResolverStartAton(rid:Integer; const addr:pSceNetInAddr; hostname:PChar; hostname_len:Integer; timeout:Integer; retry:Integer; flags:Integer):Integer; SysV_ABI_CDecl;
Expand Down

0 comments on commit e255da8

Please sign in to comment.