惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
腾讯CDC
小众软件
小众软件
G
Google Developers Blog
V
Visual Studio Blog
罗磊的独立博客
GbyAI
GbyAI
V
V2EX
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
L
LangChain Blog
Engineering at Meta
Engineering at Meta
量子位
The GitHub Blog
The GitHub Blog
博客园 - 司徒正美
WordPress大学
WordPress大学
B
Blog RSS Feed

博客园 - Calendar

windows平台下用C#访问HBase Hbase常用命令 CuteEditor测试 Windows 7使用问题 小问题之动态调用另一个程序集里的方法 GM的Hybrid MapPoint批量导入Pushpin的方法 - Calendar - 博客园 通过两个点的经纬度计算距离 地震了 下载试用IE 7.0 Beta 3.0 google maps可以支持地理信息查询了(附上功能介绍) - Calendar - 博客园 prototype理解 - Calendar - 博客园 google maps的脚本值得看看 - Calendar - 博客园 google卫星地图的url计算 linux下运行的eclipse的说明 google maps又更新了 我是如何取得Reflector的真实程序的 对J2ME的想法 MiniQQ与LumaQQ
用socket连接pop3服务器遇到的小问题
Calendar · 2006-04-26 · via 博客园 - Calendar

用socket连接pop3服务器,字符编码我采用Encoding.ASCII。
1. 发送指令 user <username>\r\n
得到+OK
2. 发送指令 pass <password>\r\n
得到+OK
3. 发送指令 list\r\n
这时,如果马上去socket.Receive(bytes),有时只能取得+OK\r\n,
而不能取得完整的数据包,虽然可以通过socket.Available进行判断到达的数据量,但有时还是取得错误的数据。
因此,在发送完 list 指令后,建议用Thread.Sleep(100)延迟一下,再去接收socket数据。
用retr <n>\r\n来接收邮件内容时,也最好建立延迟。

pop3服务器有超时时间限制,应几秒钟闲时就发个noop指令以保持连接。