Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function IsPortActive(const AHost: string; APort: Word): Boolean;
- var
- IdTCPClient: TIdTCPClient;
- begin
- Result := False;
- IdTCPClient := TIdTCPClient.Create(nil);
- try
- try
- IdTCPClient.Host := AHost;
- IdTCPClient.Port := APort;
- IdTCPClient.Connect;
- Result := True;
- except
- // ignore exceptions [really ? are you sure ?]
- end;
- finally
- IdTCPClient.Free;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement