code: def nn_setsockopt(socket, level, option, value):
      
      try:
          return _nn_setsockopt(socket, level, option, ctypes.addressof(value),
                                len(value))
      except (TypeError, AttributeError):
          buf_value = ctypes.create_string_buffer(value)
          return _nn_setsockopt(socket, level, option,
                                ctypes.addressof(buf_value), len(value))
docs: set a socket option
  
      socket - socket number
      level - option level
      option - option
      value - a readable byte buffer (not a Unicode string) containing the value
      returns - 0 on success or < 0 on error