Create a ConnectionPool to a host or a replica set of hosts. Actual TCP connection is not attempted until getPipe request, so no IOError can be raised here. Up to N TCP connections will be established to each host.

Return a TCP connection (Pipe) to the master or a slave in the server. Master must connect to the master, SlaveOk may connect to a slave or master. To spread the load, SlaveOk requests are distributed amongst all hosts in the server. Throw IOError if failed to connect to right type of host (Master/SlaveOk).