Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2164

Use socket domain instead of family

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Connections
    • None

      In https://ruby-doc.org/stdlib-2.7.0/libdoc/socket/rdoc/Socket.html#method-c-new, the Ruby terminology for the "family" argument is "socket domain", and the argument accepted is a symbol like :INET instead of traditional constants like AF_INET/PF_INET. https://stackoverflow.com/questions/4965835/network-programming-socket-function-address-family-vs-protocol-family says that protocol and address family constants are in practice interchangeable, despite theoretically being potentially different. To be in line with terminology that Ruby uses for sockets, we should rename our occurrences of "family" to "domain" and use the symbols instead of numeric constants.

      The domain and symbol terminology goes back to at least Ruby 2.3 (https://ruby-doc.org/stdlib-2.3.5/libdoc/socket/rdoc/Socket.html#method-c-new)

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: