Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8170920

SO_RCVBUF and SO_SNDBUF options problem for network channels on MacOS

    Details

    • Subcomponent:
    • Resolved In Build:
      b149
    • Verification:
      Verified

      Description

      The following code will produce the following output on MacOS:
      ——————————————————————————
      AsynchronousServerSocketChannel channel = AsynchronousServerSocketChannel.open(
                  AsynchronousChannelGroup.withThreadPool(Executors.newCachedThreadPool(Thread::new)));
          System.out.println("Initial value: " + channel.getOption(StandardSocketOptions.SO_RCVBUF));
          System.out.println("Value to set: " + Integer.MAX_VALUE);
          channel.setOption(StandardSocketOptions.SO_RCVBUF, Integer.MAX_VALUE);
          System.out.println("Result value: " + channel.getOption(StandardSocketOptions.SO_RCVBUF));
      }
      ——————————————————————————

      Output (jdk9b144):
      ——————————————————————————
      Initial value: 131072
      Value to set: 2147483647
      Result value: 65536
      ——————————————————————————
      Output (jdk9b142):
      ——————————————————————————
      Initial value: 131072
      Value to set: 2147483647
      Result value: 6710884
      ——————————————————————————

      As you can see b144 returns the value that is smaller then the initial value despite the fact that we tried to set the value that is bigger then the initial value. Seems, this is incorrect.

        Attachments

          Activity

            People

            • Assignee:
              michaelm Michael McMahon
              Reporter:
              evotchen Elena Votchennikova (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: