# File lib/mongo/util/uri_parser.rb, line 144 def connection(extra_opts, legacy=false) opts = connection_options.merge! extra_opts if(legacy) if replicaset? ReplSetConnection.new(node_strings, opts) else Connection.new(host, port, opts) end else if replicaset? MongoReplicaSetClient.new(node_strings, opts) else MongoClient.new(host, port, opts) end end end