Close() защищенный Метод

protected Close ( ) : void
Результат void
Пример #1
0
            internal virtual void close()
            {
                if (connectedChannel != null)
                {
                    connectedChannel.Close();
                }
                else if (datagramChannel != null)
                {
                    datagramChannel.Close();
                }
                else
                {
                    ssl.Close();
                    readingQueue.Close();
                    writingQueue.Close();

                    try
                    {
                        socketReader.Join();
                        socketWriter.Join();
                    }
                    catch (System.Exception)
                    {
                        // ignore
                    }
                }
            }
Пример #2
0
 /// <summary>
 /// 销毁游戏资源
 /// </summary>
 public void Dispose()
 {
     if (!mDisposed)
     {
         mDisposed = true;
         if (null != In)
         {
             In.Close();
             In = null;
         }
         if (null != Out)
         {
             Out.Close();
             Out = null;
         }
         if (null != Buffer)
         {
             Buffer.Close();
             Buffer.Dispose();
             Buffer = null;
         }
     }
 }