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

Please move ttl from MulticastSocket.send() to a different function.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      Currently the class MulticastSocket is in sun.net. I've heard that it's moving to java.net in the next release. The send() method of MulticastSocket takes two parameters: the packet to send, and the ttl with which to send the packet. I feel that setting the ttl should be done by a separate function for several reasons:

      - Setting the ttl and sending packets are different operations.
      - I might want to set the ttl without sending a packet, for instance, just after I open the socket.
      - It's not obvious that there are actually two send() methods: the one with two arguments in MulticastSocket, and the one with one argument in DatagramSocket, which sends with the last set ttl.

      If the two argument send() is thrown out, then it will still be possible, though more difficult, to send individual packets with specified ttls by synchronizing on the MulticastSocket object.
      If the two argument send() is not thrown out, then I would recommend that the documentation for the new setttl() function clearly state that DatagramSocket.send() can be used to send packets and that they will be sent with the set ttl.

        Attachments

          Activity

            People

            Assignee:
            djbrown David Brown (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: