邮件2/Pop3Command.cs

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace DotNet.Utilities
{
    /// <summary>
    /// This class represents a generic Pop3 command and 
    /// encapsulates the major operations when executing a
    /// Pop3 command against a Pop3 Server.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    internal abstract class Pop3Command<T> : IDisposable where T : Pop3Response
    {
        public event Action<string> Trace;

        protected void OnTrace(string message)
        {
            if (Trace != null)
            {
                Trace(message);
            }
        }

        private const int BufferSize = 1024;
        private const string MultilineMessageTerminator = "\r\n.\r\n";
        private const string MessageTerminator = ".";

        private ManualResetEvent _manualResetEvent;

        private byte[] _buffer;
        private MemoryStream _responseContents;

        private Pop3State _validExecuteState;
        public Pop3State ValidExecuteState
        {
            get { return _validExecuteState; }
        }

        private Stream _networkStream;
        public Stream NetworkStream
        {
            get { return _networkStream; }
            set { _networkStream = value; }
        }

        bool _isMultiline;
        /// <summary>
        /// Sets a value indicating whether this instance is multiline.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is multiline; otherwise, <c>false</c>.
        /// </value>
        protected bool IsMultiline
        {
            get
            {
后面还有 278 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。