示例#1
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

        private /* protected virtual */ void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    ////////////////////////////////////
                    // dispose managed resources here...
                    ////////////////////////////////////

                    CloseReadersAndWriters(true);

                    ///////////////////////////////////////////////////////////////////////////////////

                    if (stream != null)
                    {
                        stream.Dispose();
                        stream = null;
                    }
                }

                //////////////////////////////////////
                // release unmanaged resources here...
                //////////////////////////////////////

                disposed = true;
            }
        }
示例#2
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public void Close()
        {
            CheckDisposed();

            CloseReadersAndWriters(true);

            if (stream != null)
            {
                stream.Close();
                stream = null;
            }
        }
示例#3
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

#if NET_40 && CONSOLE
        private static Stream GetInnerStream(
            Stream stream
            )
        {
            ChannelStream channelStream = stream as ChannelStream;

            if (channelStream == null)
            {
                return(null);
            }

            return(channelStream.GetStream());
        }
示例#4
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public Channel(
            ChannelStream stream,
            Encoding encoding,
            bool appendMode,
            bool autoFlush,
            IClientData clientData
            )
            : this()
        {
            this.stream     = stream;
            this.encoding   = encoding;
            this.appendMode = appendMode;
            this.autoFlush  = autoFlush;
            this.clientData = clientData;
        }
示例#5
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

#if NETWORK
        public Channel(
            TcpListener listener,
            ChannelType channelType,
            OptionDictionary options,
            StreamFlags flags,
            IClientData clientData
            )
            : this()
        {
            this.stream = new ChannelStream(
                listener, channelType, options, flags);

            this.encoding   = null;
            this.appendMode = false;
            this.autoFlush  = false;
            this.clientData = clientData;
        }
示例#6
0
文件: Channel.cs 项目: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public Channel(
            Stream stream,
            ChannelType channelType,
            OptionDictionary options,
            StreamFlags flags,
            StreamTranslation inTranslation,
            StreamTranslation outTranslation,
            Encoding encoding,
            bool appendMode,
            bool autoFlush,
            IClientData clientData
            )
            : this()
        {
            this.stream = new ChannelStream(
                stream, channelType, options, flags, inTranslation,
                outTranslation);

            this.encoding   = encoding;
            this.appendMode = appendMode;
            this.autoFlush  = autoFlush;
            this.clientData = clientData;
        }