These are chat archives for IndySockets/Indy

Nov 2015
Nov 18 2015 15:25
Hi, using TIdEchoUDP, is it a feature that echoing a hostname returns empty string while echoing an IP correctly returns the test string i sent? Thank you
Remy Lebeau
Nov 18 2015 19:48
A hostname is resolved to an IP before any data is exchanged. You could get a blank string returned if either 1) you are echoing a blank string to begin with, 2) no reply is received from the server within the ReceiveTimeOut period (infinite by default), or 3) the hostname resolves to an IP that the echo request cannot reach.
Nov 18 2015 20:49
Hi Remy, thank you for answering. However i think the problem finally lies somewhere else, because i get blank response from echo although domain is correctly resolved (checked it with right breakpoints). Whenever i ping my local machine i get an answer, but whatever i ping outside my machine (local network or internet) returns a blank string...
That's exactly what i cover in my post here:
I'm sure i miss something obvious, but i cannot figure out what
Nov 18 2015 22:59
Try that: new project, drop a TIdEchoUDP, a label and a button. On IdEchoUDP1 set "" as host, active to true, and ReceiveTimeout to 5000. In Button1.OnClick, i call IdEchoUDP1.echo('test') and assign the result to Label1.Caption. It's an empty string...
It's important to note that it times out. That may be the explanation: it probably never gets the answer from the host, thus explaining the empty string