private void pullStack(){
      NetworkMessage m =  messageQueue.poll();
      if(m == null)
          return;
      
      try
      {
         Socket client = new Socket(m.getReceiver() , m.getPort() );
         OutputStream outToServer = client.getOutputStream();
         DataOutputStream out = new DataOutputStream(outToServer);
         //out.writeUTF(m.getString());
          switch (m.type){
              case NetworkMessage.TYPE_FILE: 
                   
                   String address  = m.content.replaceAll("@PATH:", "");
                 //  address= "/Users/anttikulppi/Documents/Trabajo/Brainshots/rails data.txt";
                  // address= "/Users/anttikulppi/Pictures/d.jpg";
                   File f = new File(address );
                   NetworkMessage m2 = new NetworkMessage(NetworkMessage.TYPE_FILE, m.gameInstance, f.getName()  );
                   
                   System.out.println(m2.content);                   
                   System.out.println("FILE START SEND");
                   out.writeBytes(m2.getString()+"!#!");
                   client.close();
                   client = new Socket(m.getReceiver() , m.getPort() );
                   outToServer = client.getOutputStream();
                   out = new DataOutputStream(outToServer);
                   
                   streamFile(f,out);       
                    client.close();           
                   System.out.println("filestream");
              break;
                  
              default:  
              //  System.out.println("enviando ##" + m.getString());
                out.writeBytes(m.getString()); 
                client.close();
              break;
                  
          }
             
         //client.close();
         
         
         
      }catch(Exception e)
      {
          messageQueue.add(m);
      }
      
      
    }