title: Indy UDP sending and responding simple strings
body: <p>I am using Delphi 10.0 Seattle. </p>
  
  <p>I'd like to send requests to a UDP server and then read the server response, which is a simple string:</p>
  
  <pre><code>Client side:send('12345')
  server side(onread event or whatever):if received string =  ('12345') then 
  send ('jhon|zack|randy')
  else disconnect;
  </code></pre>
  
  <p>The length of the response string is variable.</p>
  
  <p><strong>The server is running on a well opened network with open connection (dedicated vps).
   The client is not the same, it is behind routers and secure networks (not forwarded).</strong></p>
  
  <p>So far, I can only send the request from the client:</p>
  
  <p>(uc=idUDPclient)</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var
    s:string;
  begin
    if uc.Connected =False then
      Uc.Connect;
    uc.Send('12345');
    uc.ReceiveTimeout := 2000;
    s:=uc.ReceiveString() ;
    ShowMessage(s);
    uc.Disconnect
  end;
  </code></pre>
  
  <p>Server side  (us=idUDPserver)</p>
  
  <pre><code>procedure TForm1.usUDPRead(AThread:TIdUDPListenerThread;const AData: TIdBytes;ABinding: TIdSocketHandle);
  begin
    ShowMessage(us.ReceiveString());
  
    if us.ReceiveString() = '12345' then
    begin
      ShowMessage(us.ReceiveString());
  
      //respond with a string to the client immediately (behind a routers) how ?
    end;
  </code></pre>
  
  <p>I don't know if TCP is better, and how to use it.</p>
  
  <p>Android will be involved.</p>