def _return_socket(self, sock_info):
        try:
            self.lock.acquire()
            too_many_sockets = (self.max_size is not None
                                and len(self.sockets) >= self.max_size)

            if not too_many_sockets and sock_info.pool_id == self.pool_id:
                self.sockets.add(sock_info)
            else:
                sock_info.close()
        finally:
            self.lock.release()

        if sock_info.forced:
            sock_info.forced = False
        else:
            self._socket_semaphore.release()
Return socket to the pool. If pool is full the socket is discarded.
dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/pool.py/Pool._return_socket