H
huait
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.MSG_SERVERConnect(AThread: TIdPeerThread);
var
DSClient:TDSClient;
DeCodeKey,CodeKey:String;
DeptID:String;
CapID:String;
Sender:TObject;
Str:String;
////////////////////////////////////////////////////////////////////////////////
type
TCP_KeepAlive = record
OnOff: Cardinal;
KeepAliveTime: Cardinal;
KeepAliveInterval: Cardinal
end;
var
Val: TCP_KeepAlive;
Ret: DWord;
begin
Val.OnOff:=1;
Val.KeepAliveTime:=100;
Val.KeepAliveInterval:=3000;
WSAIoctl(AThread.Connection.Socket.Binding.Handle, IOC_IN or IOC_VENDOR or 4,
@Val, SizeOf(Val), nil, 0, @Ret, nil, nil);
//加了这部分是为了在客户端未正常断开时,通知网络,问题是:在XP下正常运行,在win2000下,隔了50多秒后就断开了,而实际上客户端还是连接着,请教各位,将此段程序完善。
end;
var
DSClient:TDSClient;
DeCodeKey,CodeKey:String;
DeptID:String;
CapID:String;
Sender:TObject;
Str:String;
////////////////////////////////////////////////////////////////////////////////
type
TCP_KeepAlive = record
OnOff: Cardinal;
KeepAliveTime: Cardinal;
KeepAliveInterval: Cardinal
end;
var
Val: TCP_KeepAlive;
Ret: DWord;
begin
Val.OnOff:=1;
Val.KeepAliveTime:=100;
Val.KeepAliveInterval:=3000;
WSAIoctl(AThread.Connection.Socket.Binding.Handle, IOC_IN or IOC_VENDOR or 4,
@Val, SizeOf(Val), nil, 0, @Ret, nil, nil);
//加了这部分是为了在客户端未正常断开时,通知网络,问题是:在XP下正常运行,在win2000下,隔了50多秒后就断开了,而实际上客户端还是连接着,请教各位,将此段程序完善。
end;