|
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 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 |
| Free embeddable forum powered by Nabble | Forum Help |