def send(self, message, peer=None, group=None):
        if peer:
            connection = self.connectionpool.get_connection_by_peer(peer)
            if connection == None:
                if self.debug: self.logger.write("Connection Error",
                                                 "Connection for %s cannot be found." % str(peer))
                return -1
            connection.send(message)
            return message[FLD_ID]
        elif group:
            ids = []
            for peer,liveness in group.iteritems():
                connection = self.connectionpool.get_connection_by_peer(peer)
                if connection == None:
                    if self.debug: self.logger.write("Connection Error",
                                                     "Connection for %s cannot be found." % str(peer))
                    continue
                connection.send(message)
                ids.append(message[FLD_ID])
                message[FLD_ID] = assignuniqueid()
            return ids
dataset/ETHPy150Open denizalti/concoord/concoord/node.py/Node.send/original