示例#1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            _reader.Dispose();
            _reader = null;

            _writer.Dispose();
            _writer = null;
        }
示例#2
0
        public NntpResponse Connect(string hostname, int port, bool useSsl)
        {
            _client.Connect(hostname, port);

            var stream = GetStream(hostname, useSsl);

            _reader = new NntpStreamReader(stream, Encoding);
            _writer = new StreamWriter(stream, Encoding)
            {
                AutoFlush = true
            };

            return(ReadResponse((code, message) => new NntpResponse(code, message)));
        }