日期:2012-12-08  浏览次数:20496 次

 

的换行标记。
14行,输出整条信息,同时将信息颜色置为灰色以示区别。

执行一个命令


--------------------------------------------------------------------------------
1 function do_command($command, $code)
2 {
3 $this->lastact=$command;
4 $this->show_debug($this->lastact, "out");
5 fputs ( $this->fp, $this->lastact );
6 $this->lastmessage = fgets ( $this->fp, 512 );
7 $this->show_debug($this->lastmessage, "in");
8 if(!ereg("^$code", $this->lastmessage))
9 {
10 return false;
11 }
12 else
13 return true;
14 }
--------------------------------------------------------------------------------
  在编写socket处理部分发现,一些命令的处理很相似,如HELOMAIL FROMRCPT TOQUITDATA命令,
都要求根据是否显示调试信息将相关内容显示出来,同时对于返回的响应码,如果是期望的,则应继续处理,