Beispiel #1
0
def attach_services():
    for s_name in services.keys():
        node.add_service(services[s_name])
        commands_list = services[s_name].attach_to_console()
        if not commands_list is None:
            for c in commands_list:
                commands[c] = services[s_name]
Beispiel #2
0
def attach_services():
    for s_name in services.keys():
        node.add_service(services[s_name])
        commands_list = services[s_name].attach_to_console()
        if not commands_list is None:
            for c in commands_list:
                commands[c] = services[s_name]
                try:
                    if commands_list[c]:
                        help_texts[c] = commands_list[c]
                except TypeError:
                    pass
Beispiel #3
0
import node as node
import service as serve
from dummy_network import *
import random
import sys
import os
from threading import *

import Topology_Service

try:
    node.ctrlPort = int(sys.argv[1])
    node.IPAddr = "localhost"
    node.thisNode = node.Node_Info(node.IPAddr, node.ctrlPort)
    Internal_service = serve.Internal_Service()
    node.add_service(Internal_service)
    node.add_service(serve.ECHO_service())
    node.net_server = start(node.thisNode, node.handle_message)
    database = db.Shelver("test.db")
    node.add_service(database)

    TOPO = Topology_Service.Topology()
    node.add_service(TOPO)

    if len(sys.argv) > 2:
        node_name = sys.argv[2]
        node_port = int(sys.argv[3])
        othernode = node.Node_Info(node_name, node_port)
        node.join(othernode)
        print node.thisNode
        print othernode