Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            // some sanity checks
            if (args.Length < 1)
            {
                Console.WriteLine ("Usage: server.exe <configfile>");
                Environment.Exit(0);
            }

            // all iz well, init
            Server server = new Server ();
            server.LoadConfig (args[0]);
            server.InitServer ();

            // keep alive
            string input = Console.ReadLine ();
            while (!input.Equals ("exit"))
            {
                if (input.Equals ("status"))
                {
                    server.m_userTableService.PrintUserTable ();
                    server.m_replicationService.PrintReplicationList ();
                    server.m_sequenceNumberService.PrintSequenceNumber ();
                }

                input = Console.ReadLine ();
            }

            // terminate gracefully
            server.Shutdown ();
        }
Ejemplo n.º 2
0
        public void SetServer(Server server)
        {
            if (server == null)
            {
                DebugFatal ("Could not set server");
            }

            m_server = server;

            m_server.m_puppetSendReceiveMiddleLayer.RegisterReceiveCallback("puppetmaster",
                                                                            new ReceiveCallbackType(Receive));
        }
Ejemplo n.º 3
0
 public void SetServer(Server server)
 {
     m_server = server;
     m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("lookup", new ReceiveCallbackType (Receive));
     m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("connect", new ReceiveCallbackType (Receive));
     m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("disconnect", new ReceiveCallbackType (Receive));
 }
Ejemplo n.º 4
0
        public void SetServer(Server server)
        {
            if (server != null)
            {
                m_server = server;
            }

            // register messages to listen too
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("replicate",
                                                                       new ReceiveCallbackType (Receive));
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("ping",
                                                                       new ReceiveCallbackType (Receive));
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("whoismaster",
                                                                       new ReceiveCallbackType (Receive));
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("whoismaster_ack",
                                                                       new ReceiveCallbackType (Receive));
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("sync_usertable",
                                                                       new ReceiveCallbackType (Receive));
            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("sync_usertable_ack",
                                                                       new ReceiveCallbackType (Receive));

            // TODO: This map should be done elsewhere and less statically
            m_serverUriToServerNameMap.Add (m_server.ServerList[0], "central-1");
            m_serverUriToServerNameMap.Add (m_server.ServerList[1], "central-2");
            m_serverUriToServerNameMap.Add (m_server.ServerList[2], "central-3");
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            //Get Local IP Address
            string host = Dns.GetHostName();
            IPHostEntry ip = Dns.GetHostEntry(host);

            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine("-           Welcome to Rob's MD5 cracker        -");
            Console.WriteLine("-                   ---SERVER---                -");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine();
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine("-             Student Number: 09002866          -");
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Server IP: " + ip.AddressList[0].ToString());
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Hash must be entered BEFORE clients connect!");
            Console.WriteLine();
            Console.WriteLine();
            Server server = new Server();
            server.hash();
        }
Ejemplo n.º 6
0
        public void SetServer(Server server)
        {
            if (server != null)
            {
                m_server = server;
            }

            m_server.m_sendReceiveMiddleLayer.RegisterReceiveCallback ("sequencenumber", new ReceiveCallbackType (Receive));
        }
Ejemplo n.º 7
0
 internal void ExecuteRequest() ////////made internal, originally private
 {
     _context = new HttpContext(this);
     Server.RaiseRequest(_context);
     WriteResponseHeaders();
 }
Ejemplo n.º 8
0
 public void initServer()
 {
     server = new Server(this);
 }