大家一直关注的问题,有了正解,可还有些不足 ( 积分: 50 )

  • 主题发起人 主题发起人 huait
  • 开始时间 开始时间
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;
 
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;
 
唉 没有知道
 
后退
顶部