'Releases a connection, returning it to the pool.
:param drop_conn: If True, the connection will be released and
not be reused. This can be used to indicate broken connections.'

def releaseconnection(self, connection, drop_conn=False):

    if (connection is None):
        return
    self.connectionlock.acquire()
    self.assignedconnections.remove(connection)
    if (connection.Terminate or drop_conn):
        connection.logout()
    else:
        self.availableconnections.append(connection)
    self.connectionlock.release()
    self.semaphore.release()
