Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1265

AsynchronousSocketChannel connect and socket timeout

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.0
    • Async
    • None

    Description

      AsynchronousSocketChannel connect essentially is blocking and you can't apply the socket timeout setting.

      You can:

      a) get a future from connect and then call get(timeout, unit) with the timeout the result to honour the socket timeout but that is blocking.
      b) pass a completion handler to connect which blocks whilst it connects and doesn't take a timeout - this is currently used.

      See: http://stackoverflow.com/questions/20752756/how-to-set-java-nio-asynchronoussocketchannel-connect-timeout essentially this functionality is not available and implementing it would be complex

      Attachments

        Activity

          People

            Unassigned Unassigned
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: