Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-165

XnioWorker.connectTcpStream throws NPE if there is no connectHandle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.0.Beta5
    • None
    • nio-impl
    • None
    • Workaround Exists
    • Hide

      Instead of NullPointerException, an IllegalArgumentException should be thrown explaining that the WORKER_ESTABILISH_WRITING should be set according to the number of read/write threads available.

      Show
      Instead of NullPointerException, an IllegalArgumentException should be thrown explaining that the WORKER_ESTABILISH_WRITING should be set according to the number of read/write threads available.

      The problem occurs when one of the options Options.WORKER_WRITE_THREADS or Options.WORKER_READ_THREADS equals 0.
      In that case, the worker has only one type of thread (either only read threads, or only write threads), and the user is stuck with choosing that type of thread for establishing connections. In other words, if Options.WORKER_WRITE_THREADS is 0, setting WORKER_ESTABLISH_WRITING to false (which is the default value) is mandatory. Similarly, if Options.WORKER_READ_THREADS is 0, Options.WORKER_ESTABLISH_WRITING must be true.

            flaviarnn Flavia Rainone
            flaviarnn Flavia Rainone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: