title: How to make this sum? Client Server UDP
body: <p>i have a client that send to a server two integers: the server have to sum them and send again the result to the client. I don't understand how can i do this sum because i don't have two integers but:</p>
  
  <pre><code>public class UDPServer {
  
  public static void main(String args[]) throws Exception { 
  
  DatagramSocket serverSocket= new DatagramSocket(1200);
  
  
  
  byte[] receiveDataA = new byte[4];
  byte[] receiveDataB = new byte[4]; 
  byte[] sendDataSum = new byte[4];//  = new byte[1024]; 
  
  
  while(true) { 
  
      DatagramPacket receivePacketA = new DatagramPacket(receiveDataA, receiveDataA.length); 
      serverSocket.receive(receivePacketA); 
  
      DatagramPacket receivePacketB = new DatagramPacket(receiveDataA, receiveDataA.length); 
      serverSocket.receive(receivePacketB);
  
      String a = new String(receivePacketA.getData(), 0, receivePacketA.getLength()); 
      String b = new String(receivePacketB.getData(), 0, receivePacketB.getLength()); 
  
      /*here i have to make the sum..how?
      */
  
  
      InetAddress IPAddress = receivePacketA.getAddress(); 
  
      int port = receivePacketA.getPort(); 
      DatagramPacket sendPacketSum = new  DatagramPacket(sendDataSum, sendDataSum.length, IPAddress, port); 
  
      serverSocket.send(sendPacketSum); 
  
  
  
  
  } 
  
  }
  </code></pre>
  
  <p>}</p>