Exemplo n.º 1
0
        /// <summary>
        /// creates a server and opens the client side program too. Starts listening on the server.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            TempServer tempServer = new TempServer();

            tempServer.LoadFiles();

            Console.WriteLine("Welcome to Dallin's Joke/Conspiracy Server");
            Console.WriteLine("------------------------------------------");

            /* while (true)
             * {
             *   Console.WriteLine("Type q to quit");
             *   string userInput = Console.ReadLine();
             *   if (userInput == "q")
             *   {
             *       break;
             *   }
             *   Console.WriteLine($"Joke: {tempServer.GetRandomJoke()}");
             *   Console.WriteLine($"Conspiracy: {tempServer.GetRandomConspiracy()}");
             *
             * } */
            Process process = new Process();

            process.StartInfo.FileName = @"C:\Users\dalli\source\repos\ClientServerApp\ClientApp\bin\Debug\ClientApp.exe";
            process.Start();
            SynchronousSocketListener ssl = new SynchronousSocketListener();

            ssl.StartListening();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //// Instantiate the server
            //TempServer tempServer = new TempServer();
            //// Tell the server to load the files
            //tempServer.LoadFiles();

            Console.WriteLine("Welcome to Jacob's Joke/Conspiracy Server");
            Console.WriteLine("-----------------------------------------");
            //while (true)
            //{
            //    Console.WriteLine("Type q to quit");
            //    string userInput = Console.ReadLine();
            //    // continue to run the console app until q is pressed
            //    if(userInput == "q")
            //    {
            //        break;
            //    }
            //    Console.WriteLine($"Joke: {tempServer.GetRandomJoke()}");
            //    Console.WriteLine($"Conspiracy: {tempServer.GetRandomConspiracy()}");
            //}

            SynchronousSocketListener ssl = new SynchronousSocketListener();

            ssl.StartListening();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Jacob's UVUFact or UVUMajor Server");
            Console.WriteLine("-----------------------------------------");

            // Setup SSL connection
            SynchronousSocketListener ssl = new SynchronousSocketListener();

            ssl.StartListening();
        }