Some changes for OS/2

This commit is contained in:
mysticbbs 2012-08-24 13:18:46 -04:00
parent f72b920e48
commit c64481a7ed
1 changed files with 13 additions and 3 deletions

View File

@ -394,7 +394,12 @@ End;
Function TIOSocket.ReadBuf (Var Buf; Len: LongInt) : LongInt; Function TIOSocket.ReadBuf (Var Buf; Len: LongInt) : LongInt;
Begin Begin
If FInBufPos = FInBufEnd Then Begin If FInBufPos = FInBufEnd Then Begin
{$IFDEF OS2}
FInBufEnd := Winsock.Recv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT);
{$ELSE}
FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT);
{$ENDIF}
FInBufPos := 0; FInBufPos := 0;
If FInBufEnd <= 0 Then Begin If FInBufEnd <= 0 Then Begin
@ -541,7 +546,12 @@ Begin
If fpListen(FSocketHandle, 5) = -1 Then Exit; If fpListen(FSocketHandle, 5) = -1 Then Exit;
Temp := SizeOf(SIN); Temp := SizeOf(SIN);
{$IFDEF OS2}
Sock := Winsock.Accept(FSocketHandle, @SIN, @Temp);
{$ELSE}
Sock := fpAccept(FSocketHandle, @SIN, @Temp); Sock := fpAccept(FSocketHandle, @SIN, @Temp);
{$ENDIF}
If Sock = -1 Then Exit; If Sock = -1 Then Exit;