S
sunqi
Unregistered / Unconfirmed
GUEST, unregistred user!
我要改变SOCKET 的默认接受和发送的延时设置都成功了但我重新读取时发现没有被
更改,总显示是 4 不知是什么原因呢?
代码如下:
VAR
sHandle : CARDINAL ;
TIMEOUT,timess : integer ;
x : integer ;
begin
sHandle:=ServerSocket1.Socket.SocketHandle;
timeout:=1000 ;
if setsockopt(SHandle,SOL_SOCKET,SO_SNDTIMEO,pchar(@timeout),sizeof(timeout))<>SOCKET_ERROR then
begin
getsockopt(sHandle,SOL_SOCKET,SO_SNDTIMEO,@timess,timess);
Showmessage(INTTOSTR(timess));
end else
Showmessage('设置不成功');
更改,总显示是 4 不知是什么原因呢?
代码如下:
VAR
sHandle : CARDINAL ;
TIMEOUT,timess : integer ;
x : integer ;
begin
sHandle:=ServerSocket1.Socket.SocketHandle;
timeout:=1000 ;
if setsockopt(SHandle,SOL_SOCKET,SO_SNDTIMEO,pchar(@timeout),sizeof(timeout))<>SOCKET_ERROR then
begin
getsockopt(sHandle,SOL_SOCKET,SO_SNDTIMEO,@timess,timess);
Showmessage(INTTOSTR(timess));
end else
Showmessage('设置不成功');