public void Listen(int port)
 {
     var node = new TcpNode (port);
     node.Listen (port);
     Node.Connect ("localhost:" + port);
     //	nodes.Add (node);
 }
Exemple #2
0
        public override int Run(string[] remainingArguments)
        {
            if(remainingArguments[0] == "stop"){
                if(node != null){
                    Console.WriteLine("stopping " + node.Id);
                    Cleanup();
                }
                return 0;
            }
            Cleanup ();

            var name = remainingArguments[0];
            var port = remainingArguments[1].Convert<int>();
            node = new TcpNode(port, name);
            node.Listen(port, isLocalOnly: false);
            node.AddBuiltins();

            Console.WriteLine("node " + node.Id + " listening on " + port);
            return 0;
        }
Exemple #3
0
 public static TcpNode Open(int defaultPort = 0, string name = null)
 {
     var n = new TcpNode(defaultPort, name);
     n.Listen(defaultPort);
     return n;
 }