var
keepalive: tcp_keepalive;
t: DWORD;
...
WSAIoctl(socket, SIO_KEEPALIVE_VALS, @keekalive, SizeOf(tcp_keepalive),
nil, 0, t, nil, nil);
indy下…………
没法了……
keepalive: tcp_keepalive;
t: DWORD;
...
WSAIoctl(socket, SIO_KEEPALIVE_VALS, @keekalive, SizeOf(tcp_keepalive),
nil, 0, t, nil, nil);
indy下…………
没法了……
Form1: TForm1;
ServerCount,ClientCount:integer;
implementation
{$R *.dfm}
procedure TForm1.NMUDP1DataReceived(Sender: TComponent;
NumberBytes: Integer; FromIP: String; Port: Integer);
begin
ServerCount:=ServerCount+1;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ClientCount:=ClientCount+1;
if ClientCount > ServerCount+1 then Showmessage('掉线了');
end;