procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
TcpClient.Active := False;
for i := 0 to listviewServers.Items.Count -1 do
begin
Connected := False;
Error := False;
TcpClient.Active := True;
TcpClient.RemotePort := '4899';
TcpClient.RemoteHost := listviewServers.Items.Item[i].SubItems[0];
if Connected = True then
begin
listviewServers.Items.Item[i].SubItems[1] := 'Online';
TcpClient.Active := False;
end
else if Error = True then
begin
listviewServers.Items.Item[i].SubItems[1] := 'Offline';
TcpClient.Active := False;
end;
end;
end;