Example #1
0
  /** @param args */
  protected void service_run() {

    // Startup NDNx in a blocking call
    if (!initializeNDNx()) {
      Log.e(TAG, "Could not start NDNx services!");
    } else {
      Log.i(TAG, "Starting ndnChatNet.listen() loop");

      // Now do the Chat event loop
      try {
        _chat.listen();
      } catch (ConfigurationException e) {
        System.err.println("Configuration exception running ndnChat: " + e.getMessage());
        e.printStackTrace();
      } catch (IOException e) {
        System.err.println("IOException handling chat messages: " + e.getMessage());
        e.printStackTrace();
      } catch (Exception e) {
        System.err.println("Exception handling chat messages: " + e.getMessage());
        e.printStackTrace();
      }
    }

    Log.i(TAG, "service_run() exits");
  }