def insert_socket(self, socket):
    with self.llc.lock:
        try:
            insertable = (type(socket) == type(self.sock_list[0]))
        except IndexError:
            insertable = True
        if insertable:
            socket.bind(self.addr)
            self.sock_list.appendleft(socket)
        else:
            log.error("can't insert socket of different type")
        return insertable
def insert_socket(self, socket):
    with self.llc.lock:
        try:
            insertable = (type(socket) == type(self.sock_list[0]))
        except IndexError:
            insertable = True
        if insertable:
            socket.bind(self.addr)
            self.sock_list.appendleft(socket)
        else:
            log.error("can't insert socket of different type")
        return insertable