2014-12-08 80 views
-1

它是我的应用程序在调试模式下的日志:什么会谈IMAP邮件服务器? ↨♥

与imap.ya.ru交谈:http://s013.radikal.ru/i325/1412/10/14b46c9d7a2c.png

与imap.gmail.com交谈:http://s61.radikal.ru/i174/1412/d2/113d5fc6289f.png

什么意思是这些符号?

我使用C#。

我包括:我的代码的

using System; 
using System.Collections.Generic; 
using System.Diagnostics; 
using System.Drawing; 
using System.IO; 
using System.Net.Security; 
using System.Net.Sockets; 
using System.Text; 
using System.Threading; 
using System.Windows.Forms; 

片段:

int port = useSSL ? portIMAPoverSSL : portIMAP; 
Stream stream = new TcpClient(ImapServerName,port).GetStream(); 
stream.ReadTimeout = 10; 
if (useSSL) 
{ 
    SslStream ssl = new SslStream(stream); 
    ssl.AuthenticateAsClient(ImapServerName); 
    stream = ssl; 
} 
StreamWriter w = new StreamWriter(stream,Encoding.ASCII); 
w.AutoFlush = true; 
StreamReader r = new StreamReader(stream,Encoding.ASCII); 

读取服务器消息并没有阻止GUI我使用这个程序:

static string readServerAndProcessMessages() 
{ 
     while (true) 
     { 
      try 
      { 
       return r.ReadLine(); 
      } 
      catch(IOException e) 
      { 
       Application.DoEvents(); 
      } 
     } 
} 

,有时这代码:

string serv = readServerAndProcessMessages(); 

,退货(不含<>):<↨♥☺>,有时候还有<↨♥☺0>作为服务器响应的前缀。这是什么意思? IMAP4 RFC被采纳,任何有关此信息我没有找到。

+0

什么是客户端软件? – Stan 2014-12-08 08:54:50

+0

我自己的应用程序,用C#编写 – biv 2014-12-08 09:01:24

+0

您是否为正在发出的命令指定了正确的标记?哪部分代码打印这些符号?它看起来像一些变量没有被初始化,如果只是你没有编程你的客户端的方式,它表示一些功能/状态与这些符号。 – Stan 2014-12-08 09:17:20

回答

2

错误来源被发现!!!

由于:

stream.ReadTimeout = 10; 

,SSL协议小裂纹,出现↨♥☺工件!!!

使用异步读取操作,此BUG消失!我很开心。

相关问题