Fórum Verificar se uma porta TCP esta aberta #532087
17/09/2015
0
Minha duvida de novo:
como verificar se uma porta TCP esta aperta no momento
estou tentando assim:
IdTCPClient.RemoteHost := Edit1.Text;
IdTCPClient.RemotePort := Edit2.Text;
If IdTCPClient.Connected then
//ImageList1.Draw(ListBox1.Canvas, Rect.Left+180, Rect.Top, 1)
ListBox1.Items.Add('sim')
else
//ImageList1.Draw(ListBox1.Canvas, Rect.Left+180, Rect.Top, 0);
ListBox1.Items.Add('não');
IdTCPClient.Active:= false;
IdTCPClient.Disconnect;
Quando esta aberta occorre tudo bem mas
quando esta fechado o aplicativo trava e adiciona varios "não" no listbox
se alguém pode mi ajudar agradeço...
Cgm2k7 2013
Curtir tópico
+ 0Posts
18/09/2015
Cgm2k7 2013
Gostei + 0
18/09/2015
Mateus Ribeiro
Veja se isso te ajuda: [url:descricao=Verificar se uma porta TCP está aberta usando o Delphi e Winsocks]https://theroadtodelphi.wordpress.com/2010/02/21/checking-if-a-tcp-port-is-open-using-delphi-and-winsocks/[/url]
Depois posta de resolveu.
Gostei + 0
18/09/2015
Cgm2k7 2013
o form trava por 2segundos
Gostei + 0
22/09/2015
Cgm2k7 2013
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)