예제 #1
0
        public void Dispose()
        {
            try
            {
                OnClosed(Guid);

                Stream.Close();
                Stream.Dispose();

                Sock.Close();
                Sock.Dispose();

                clientThread.Abort();
                clientThread.Join();
            }
            catch (ThreadAbortException ex)
            {
                string exMsg = string.Empty;

                exMsg = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name + ":" +
                        System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + ex.StackTrace + Environment.NewLine +
                        System.Reflection.MethodBase.GetCurrentMethod().Name + "():" + ex.Message;
                Console.WriteLine("THREAD ABORT ERROR :: " + exMsg);
            }
            catch (Exception ex)
            {
                string exMsg = string.Empty;

                exMsg = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name + ":" +
                        System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + ex.StackTrace + Environment.NewLine +
                        System.Reflection.MethodBase.GetCurrentMethod().Name + "():" + ex.Message;
                Console.WriteLine("Dispose ERROR :: " + exMsg);
            }
        }
예제 #2
0
 public void Dispose()
 {
     Reader.Dispose();
     Stream.Dispose();
     Sock.Close();
     Sock.Dispose();
     Lock.Dispose();
 }
예제 #3
0
        public void Stop()
        {
            Closing = true;
            Stream.Close();
            Sock.Close();

            Stream.Dispose();
            Sock.Dispose();
        }