title: Reading data with TIdUDPServer
body: <p>I would like to read data from an electronic device that sends data to my PC by UDP. I have programmed a UDP server in Delphi. An exception occurs in class EIdSocketError (Failure #10049). Here is my code:</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  begin
     IdUDPServer1.Bindings.add.IP := '192.168.1.1';  //Electronic device ip
     IdUDPServer1.Bindings.add.Port:= 49152;         //Electronic device port   
     IdUDPServer1.OnUDPRead:= UDPRead;
     IdUDPServer1.Active:=True;
  
  end;
  
  procedure TForm1.UDPRead (Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
  var
     bytes_received: integer;
  begin
     bytes_received:=AData.size;
  end;
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks in advance</p>