예제 #1
0
        public Sink()
        {
            var debugFile = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\vmccdebug.txt";

            if(File.Exists(debugFile)) {
                Trace.Listeners.Add(new TextWriterTraceListener(debugFile));
            }

            Trace.AutoFlush = true;
            Trace.TraceInformation("Sink started");

            try {
                listeningPortNumber = GetPortNumberForUserType(BASE_PORT);
                keyboardHook = new KeyboardHook();
                SocketServer = new TcpSocketServer();
            }
            catch (Exception ex) {
                Trace.TraceError(ex.ToString());
                throw;
            }
            finally {
                Trace.Unindent();
                Trace.TraceInformation("MsasSink() End");
            }
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MsasSink"/> class.
 /// </summary>
 public MediaSink()
 {
     Trace.TraceInformation("MsasSink() Start");
     Trace.Indent();
     try
     {
         Trace.TraceInformation("Build version {0}", VersionInfo);
         m_portNumber = GetPortNumber(BASE_PORT);
         m_keyboardHook = new KeyboardHook();
         m_socketServer = new TcpSocketServer();
         m_eventSchedule = new EventSchedule();
     }
     catch (EventScheduleException ex)
     {
         //  This will happen if the user has not set up the EPG but it is not fatal
         Trace.TraceError(ex.ToString());
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.ToString());
         throw;
     }
     finally
     {
         Trace.Unindent();
         Trace.TraceInformation("MsasSink() End");
     }
 }