title: How to clear ARP Table through code?
body: <p>I have an android tab with hotspot turned on. When other wifi enabled devices get connected to my android device , their IP Address and other details get stored in the ARP table and I can access those details by reading from "/proc/net/arp" and I am showing them in a list. But when one device gets disconneted from my hotspot enabled android tab then the corresponding details related to that device are not getting cleared from the ARP table(When I read "/proc/net/arp" , the ARP table still holds the details of disconnected device). I want to Clear the details of the device which is disconnected.</p>
  
  <p>Here is the code (accessing ARP table) </p>
  
  <pre><code>public ArrayList&lt;ClientScanResultSO&gt; getClientList(boolean onlyReachables,
      int reachableTimeout) {
      BufferedReader br = null;
      ArrayList&lt;ClientScanResultSO&gt; result = null;
  
      try {
          result = new ArrayList&lt;ClientScanResultSO&gt;();
          br = new BufferedReader(new FileReader("/proc/net/arp"));
          String line;
          while ((line = br.readLine()) != null) {
              String[] splitted = line.split(" +");
  
              if ((splitted != null) &amp;&amp; (splitted.length &gt;= 4)) {
                  // Basic sanity check
                  String mac = splitted[3];
  
                  if (mac.matches("..:..:..:..:..:..")) {
                      boolean isReachable = InetAddress
                              .getByName(splitted[0]).isReachable(
                                      reachableTimeout);
                      String name = InetAddress.getByName(splitted[0]).getHostName();
                      if (!onlyReachables || isReachable) {
                          result.add(new ClientScanResultSO(splitted[0],
                                  splitted[3], splitted[5], isReachable,name));
                      }
                  }
              }
          }
      } catch (Exception e) {
          Log.e(this.getClass().toString(), e.getMessage());
      } finally {
          try {
              br.close();
          } catch (IOException e) {
              Log.e(this.getClass().toString(), e.getMessage());
          }
      }
  
      return result;
  }
  </code></pre>
  
  <p>Hope I am clear with my question.</p>