Example #1
0
        internal static void registerChannel(Interp interp, Channel chan)
        {

            if (interp != null)
            {
                Hashtable chanTable = getInterpChanTable(interp);
                SupportClass.PutElement(chanTable, chan.ChanName, chan);
                chan.refCount++;
            }
        }
Example #2
0
        internal static void unregisterChannel(Interp interp, Channel chan)
        {

            Hashtable chanTable = getInterpChanTable(interp);
            SupportClass.HashtableRemove(chanTable, chan.ChanName);

            if (--chan.refCount <= 0)
            {
                try
                {
                    chan.Close();
                }
                catch (IOException e)
                {
                    throw new TclRuntimeError("TclIO.unregisterChannel() Error: IOException when closing " + chan.ChanName + ": " + e.Message, e);
                }
            }
        }
Example #3
0
 private void put(Channel channel, string s)
 // The String to print.
 {
   try
   {
     channel.Write(interp, s);
     channel.Flush(interp);
   }
   catch (System.IO.IOException ex)
   {
     System.Console.Error.WriteLine("IOException in Shell.put()");
     SupportClass.WriteStackTrace(ex, System.Console.Error);
   }
   catch (TclException ex)
   {
     System.Console.Error.WriteLine("TclException in Shell.put()");
     SupportClass.WriteStackTrace(ex, System.Console.Error);
   }
 }
Example #4
0
    internal ConsoleThread(Interp i)
    {
      Name = "ConsoleThread";
      interp = i;
      sbuf = new System.Text.StringBuilder(100);

      out_Renamed = TclIO.GetStdChannel(StdChannel.STDOUT);
      err = TclIO.GetStdChannel(StdChannel.STDERR);
    }