title: Datagram sockets with Java client and Python server
body: <p>I am triying to comunicate 2 machines through datagram sockets but I guess I am missing something...
  Machine A is runs an Android App (client)
  Machine B is a server writen in Python</p>
  
  <p>I can send a message from A to B without any problem, but A never gets the answer from B, the code is the following:</p>
  
  <p>Client (Java) :</p>
  
  <pre><code>InetAddress serverAddr = InetAddress.getByName("10.0.0.10");
  DatagramSocket socket = new DatagramSocket();
  byte[] bufSent = "register".getBytes();
  DatagramPacket dpSent = new DatagramPacket(bufSent,bufSent.length, serverAddr, 8088);
  socket.send(dpSent);
  byte[] bufRecv = new byte[1024];
  DatagramPacket dpReceive = new DatagramPacket(bufRecv, bufRecv.length);
  socket.receive(dpReceive);
  String serverMessage = new String(dpReceive.getData(), 0, dpReceive.getLength());
  Log.v(LOGTAG, "Received " + serverMessage);
  </code></pre>
  
  <p>Server (Python):</p>
  
  <pre><code>import socket
  UDP_IP_DEST = "10.0.0.11"
  UDP_IP = "10.0.0.10"
  UDP_PORT = 8088
  
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
  sock.bind((UDP_IP, UDP_PORT))
  while True:
      data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
      if data:
          print "received message:", data
          sock.sendto("I got the message", (UDP_IP_DEST, UDP_PORT))
  </code></pre>
  
  <p>Does anyone see where is the mistake? The point is that I have tried to send the answer to another machine instead of the mobile and it works fine.</p>
  
  <p>Thanks a lot.</p>