Exemple #1
0
        private void OnReceiveCompleted(ReceiveEventArgs args)
        {
            ReceiveCompletedHandler handler = ReceiveCompleted;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemple #2
0
        /// <summary>
        /// 释放资源
        /// </summary>
        /// <param name="disposing">是否也释放托管资源</param>
        protected virtual void Dispose(bool disposing)
        {
            this.Shutdown();
            this.StreamReader.Stream.Dispose();

            if (disposing)
            {
                this.socketRoot              = null;
                this.Socket                  = null;
                this.Tag                     = null;
                this.StreamReader            = null;
                this.CloseHandler            = null;
                this.DisconnectHandler       = null;
                this.ReceiveCompletedHandler = null;
            }
        }