// first of all we spawn a thread that takes care of the timers... public VCRScheduler(YAPS.HttpServer Http_Server_Object) { Recordings = new Hashtable(); doneRecordings = new Hashtable(); done = false; internal_http_server_object = Http_Server_Object; Category_Processor = new CategoryProcessor(internal_http_server_object); }
public MulticastProcessor(IPAddress ip_address, IPEndPoint ip_endpoint, YAPS.HttpServer http_server_object, ushort MulticastProcessorID, bool isRTP_) { ReceiverList = new Hashtable(); ipep = ip_endpoint; ip = ip_address; my_ID = MulticastProcessorID; internal_http_server_object = http_server_object; diedalready = false; isRTP = isRTP_; }
/// <summary> /// Handles a single VCR recording and spawns a new MulticastProcessor if needed or reuses one if existing /// </summary> /// <param name="url"></param> /// <param name="internal_http_server_object"></param> public void HandleVCR(StationAndChannel Channel, YAPS.HttpServer internal_http_server_object) { internal_HTTP_Server_Object = internal_http_server_object; #region build the channel ip endpoints... myChannel = Channel; IPAddress ip = null; IPEndPoint ipep; ip = IPAddress.Parse(myChannel.MulticastIP); ipep = new IPEndPoint(IPAddress.Any, int.Parse(myChannel.MulticastPort)); #endregion #region MulticastProcessor checking and spawning/reusing lock (internal_http_server_object.MulticastProcessorList.SyncRoot) { if (internal_http_server_object.MulticastProcessorList.ContainsKey(myChannel.ServiceID)) { // okay we have a MulticastProcessor already // get that MulticastProcessor object internal_Multicast_Processor_Object = (MulticastProcessor)internal_http_server_object.MulticastProcessorList[myChannel.ServiceID]; lock (internal_Multicast_Processor_Object.ReceiverList.SyncRoot) { // add myself to the list internal_Multicast_Processor_Object.ReceiverList.Add(myID, this); } } else { // we don't have a MulticastProcessor yet // create one internal_Multicast_Processor_Object = new MulticastProcessor(ip, ipep, internal_http_server_object, myChannel.ServiceID, myChannel.isRTP); // add him to the global list lock (internal_http_server_object.MulticastProcessorList.SyncRoot) { internal_http_server_object.MulticastProcessorList.Add(myChannel.ServiceID, internal_Multicast_Processor_Object); } lock (internal_Multicast_Processor_Object.ReceiverList.SyncRoot) { internal_Multicast_Processor_Object.ReceiverList.Add(myID, this); } Thread thread = new Thread(new ThreadStart(internal_Multicast_Processor_Object.Go)); thread.Start(); } } #endregion }
public void HandleStreaming(String url, YAPS.HttpProcessor http_processor_object) { #region build the channel ip endpoints... try { // try to resolve the name myChannel = ChannelAndStationMapper.Name2Data(url.Remove(0, 5)); if (myChannel == null) { myChannel = ChannelAndStationMapper.Number2Data(Convert.ToInt32(url.Remove(0, 5))); // nothing to do here... if (myChannel == null) return; } } catch (Exception e) { ConsoleOutputLogger.WriteLine("HandleStreaming: " + e.Message); } IPAddress ip = null; IPEndPoint ipep; internal_HTTP_Processor_Object = http_processor_object; internal_HTTP_Processor_Object.ns.WriteTimeout = 1000; ip = IPAddress.Parse(myChannel.MulticastIP); ipep = new IPEndPoint(IPAddress.Any, int.Parse(myChannel.MulticastPort)); // long left = file.Length; internal_HTTP_Processor_Object.writeSuccess(0); #endregion #region MulticastProcessor checking and spawning/reusing lock (internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList.SyncRoot) { foreach (MulticastProcessor m in internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList.Values) { ConsoleOutputLogger.WriteLine("we have a MulticastProcessor for " + m.my_ID); if (m.diedalready) ConsoleOutputLogger.WriteLine("it died already..."); else ConsoleOutputLogger.WriteLine("which is living..."); } if (internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList.ContainsKey(myChannel.ServiceID)) { // okay we have a MulticastProcessor already ConsoleOutputLogger.WriteLine("Reusing MulticastProcessor for channel " + myChannel.ChannelName); // get that MulticastProcessor object internal_Multicast_Processor_Object = (MulticastProcessor)internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList[myChannel.ServiceID]; lock (internal_Multicast_Processor_Object.ReceiverList.SyncRoot) { // add myself to the list internal_Multicast_Processor_Object.ReceiverList.Add(myID, this); } } else { // we don't have a MulticastProcessor yet ConsoleOutputLogger.WriteLine("Creating a new MulticastProcessor for channel " + myChannel.ChannelName); // create one internal_Multicast_Processor_Object = new MulticastProcessor(ip, ipep, internal_HTTP_Processor_Object.HTTPServer, myChannel.ServiceID, myChannel.isRTP); lock (internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList.SyncRoot) { // add him to the global list internal_HTTP_Processor_Object.HTTPServer.MulticastProcessorList.Add(myChannel.ServiceID, internal_Multicast_Processor_Object); } lock (internal_Multicast_Processor_Object.ReceiverList.SyncRoot) { internal_Multicast_Processor_Object.ReceiverList.Add(myID, this); } Thread thread = new Thread(new ThreadStart(internal_Multicast_Processor_Object.Go)); thread.Start(); } } #endregion }
public CategoryProcessor(YAPS.HttpServer Http_Server_Object) { Categories = new List<Category>(); internal_http_server_object = Http_Server_Object; }
public XBMCSyncProcessor(YAPS.HttpServer Http_Server_Object) { done = false; internal_http_server_object = Http_Server_Object; }