Uploaded image for project: 'Hama'
  1. Hama
  2. HAMA-966

NioServerListener doesn't throw any exceptions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.7.0
    • 0.7.1
    • bsp core
    • None

    Description

      NioServerListener which extends Thread can't throw any exceptions because it swallows them in run() as follows.

      try {
        // code for server bootstraping and binding
      } catch (Exception e) {
        e.printStackTrace();
      }
      

      This results in that startServer() can't catch BindException and retry to start the server recursively. There can be two options.

      • Option 1. Use Thread.UncaughtExceptionHandler.
      • Option 2. Make NioServerListener extend Callable and use get() of Future to catch exceptions.

      I think Option 2 looks better because the code could be more intuitive.

      Attachments

        1. HAMA-966.patch
          8 kB
          JongYoon Lim

        Activity

          People

            seedengine JongYoon Lim
            seedengine JongYoon Lim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: