[fpc-pascal] SO_RCVTIMEO
Anton Tichawa
anton.tichawa at chello.at
Wed Sep 14 15:51:16 CEST 2005
Paul Davidson wrote:
> Trying to get SetSocketOptions for SO_RCVTIMEO and SO_SNDTIMEO to work
> with Darwin (FreeBSD).
>
> type
> p : pointer;
> t : TimeVal;
>
> t.tv_sec := mSec div 1000;
> t.tv_usec := ( mSec mod 1000 ) * 1000;
> p := @t;
> if SetSocketOptions( fSocket, SOL_SOCKET, SO_SNDTIMEO, p, SizeOf( t )
> ) <> 0 etc
>
According to my docs, SetSocketOptions is declared
function SetSocketOptions(
Sock: LongInt;
Level: LongInt;
OptName: LongInt;
const OptVal;
optlen: LongInt
):LongInt;
So, I think you should pass p^ (the data pointed to by p) rather than p.
HTH,
Anton.
More information about the fpc-pascal
mailing list