Re: Video Streaming [Console skeleton]

View: New views
1 Messages — Rating Filter:   Alert me  

Re: Video Streaming [Console skeleton]

by Chris Cowherd :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Maybe its just my email client but that code I posted got completely munged.  I'll try again plus I'll attach it too this time.

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.IO;
using System.Reflection;
using FluorineFx.Messaging;
using System.ServiceProcess;

namespace BakedOn.LocalServer
{
    static class Program
    {
        [DllImport("kernel32.dll")]
        static extern bool AttachConsole(int dwProcessId);
        const int ATTACH_PARENT_PROCESS = -1;

        static void Main(string[] args)
        {
            //if (args.Length > 0)
            {
                RunConsole();
            }
//else
//{
//    ServiceBase[] ServicesToRun;
//    ServicesToRun = new ServiceBase[] 
//    { 
//        new ServiceHost() 
//    };
//    ServiceBase.Run(ServicesToRun);
//}
        }

        private static void RunConsole()
        {
            AttachConsole(ATTACH_PARENT_PROCESS);


            Assembly assy = Assembly.GetExecutingAssembly();
            string path = assy.Location.Substring(0, assy.Location.LastIndexOf("\\"));

            MessageServer server = new MessageServer();
            server.Init(path + @"\web-inf\flex");
            server.Start();


            bool running = true;
            while (running)
            {
                string command = Console.ReadLine().ToLower();
                switch (command)
                {
                    case "quit":
                        running = false;
                        break;

                    default:
                        Console.WriteLine("Unrecognized command: " + command);
                        break;
                }
            }

            server.Stop();

            Console.WriteLine("Server stopped. Press ENTER.");
            Console.ReadLine();
        }
    }
}


Hotmail: Trusted email with Microsoft's powerful SPAM protection. Sign up now.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.IO;
using System.Reflection;
using FluorineFx.Messaging;
using System.ServiceProcess;

namespace BakedOn.LocalServer
{
    static class Program
    {
        [DllImport("kernel32.dll")]
        static extern bool AttachConsole(int dwProcessId);
        const int ATTACH_PARENT_PROCESS = -1;

        static void Main(string[] args)
        {
            //if (args.Length > 0)
            {
                RunConsole();
            }
                        //else
                        //{
                        //    ServiceBase[] ServicesToRun;
                        //    ServicesToRun = new ServiceBase[]
                        //    {
                        //        new ServiceHost()
                        //    };
                        //    ServiceBase.Run(ServicesToRun);
                        //}
        }

        private static void RunConsole()
        {
            AttachConsole(ATTACH_PARENT_PROCESS);


            Assembly assy = Assembly.GetExecutingAssembly();
            string path = assy.Location.Substring(0, assy.Location.LastIndexOf("\\"));

            MessageServer server = new MessageServer();
            server.Init(path + @"\web-inf\flex");
            server.Start();


            bool running = true;
            while (running)
            {
                string command = Console.ReadLine().ToLower();
                switch (command)
                {
                    case "quit":
                        running = false;
                        break;

                    default:
                        Console.WriteLine("Unrecognized command: " + command);
                        break;
                }
            }

            server.Stop();

            Console.WriteLine("Server stopped. Press ENTER.");
            Console.ReadLine();
        }
    }
}
_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com