2014-12-08 75 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消失!我很開心。

相關問題