Skip to content

Commit

Permalink
fix incompatible type
Browse files Browse the repository at this point in the history
  • Loading branch information
zamronypj committed Jul 8, 2019
1 parent 8bfbb4a commit 0c9c34a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Libs/Socket/InetSocketSvrImpl.pas
Expand Up @@ -101,7 +101,7 @@ implementation
procedure TInetSocketSvr.bind();
begin
FInetAddr.sin_family := AF_INET;
FInetAddr.sin_port := ShortHostToNet(FPort);
FInetAddr.sin_port := htons(FPort);
FInetAddr.sin_addr.s_addr := LongWord(StrToNetAddr(FHost));
if fpBind(fListenSocket, @FInetAddr, sizeof(FInetAddr)) <> 0 then
begin
Expand All @@ -116,8 +116,10 @@ implementation
* @return client socket which data can be read
*-----------------------------------------------*)
function TInetSocketSvr.accept(listenSocket : longint) : longint;
var addrLen : TSockLen;
begin
result := fpAccept(listenSocket, @FInetAddr, sizeof(FInetAddr));
addrLen := sizeof(FInetAddr);
result := fpAccept(listenSocket, @FInetAddr, @addrLen);
end;

end.
5 changes: 4 additions & 1 deletion Libs/Socket/UnixSocketSvrImpl.pas
Expand Up @@ -119,8 +119,11 @@ implementation
* @return client socket which data can be read
*-----------------------------------------------*)
function TUnixSocketSvr.accept(listenSocket : longint) : longint;
var addrLen : TSockLen;
begin
result := fpAccept(listenSocket, @FUnixAddr, fSocketAddrLen);
addrLen := fSocketAddrLen;
result := fpAccept(listenSocket, @FUnixAddr, @addrLen);
fSocketAddrLen := addrLen;
end;

(*!-----------------------------------------------
Expand Down

0 comments on commit 0c9c34a

Please sign in to comment.