unit checkhostinthread;

interface

uses
  Classes,winsock,windows,sysutils;

type
  checkhostthread = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; override;
  public
  address  : string;
  end;

implementation

{ Important: Methods and properties of objects in VCL can only be used in a
  method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure checkhostthread.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ checkhostthread }

procedure checkhostthread.Execute;
var
Paddress : array [0..15] of char;
H : Phostent;
a  : integer;
StartupData : TWSADATA;
ver : word;
begin
returnvalue:=1;
ver:=makeword(1,1);
a:=WSAStartup (ver,StartupData);
if a<>0 then begin;WSACleanup;returnvalue:=0;exit;end;
StrPCopy(Paddress,address);
H := GetHostByName(Paddress);
if H=nil then returnvalue:=0;
WSACleanup;
end;

end.