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

Socket should specify buffer size unit

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      java.net.Socket and java.net.DatagramSocket have methods for modifying the send and receive buffer size. However, apparently nowhere in the documentation is the data unit specified, so it is not clear whether it is bit or byte. One could deduce the data unit from the option meaning for Linux (socket(7)), however it would be better if the data unit was mentioned in the Java documentation.

      Affected:
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/SocketOptions.html#SO_SNDBUF
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/SocketOptions.html#SO_RCVBUF

      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/Socket.html#getReceiveBufferSize()
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/Socket.html#getSendBufferSize()
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/Socket.html#setReceiveBufferSize(int)
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/net/Socket.html#setSendBufferSize(int)


            dfuchs Daniel Fuchs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: