예제 #1
0
 /**
  * @param string $sRaw
  * @param bool $bWriteToLog = true
  * @param string $sFakeRaw = ''
  *
  * @return void
  *
  * @throws \MailSo\Net\Exceptions\SocketConnectionDoesNotAvailableException
  * @throws \MailSo\Net\Exceptions\SocketWriteException
  */
 protected function sendRaw($sRaw, $bWriteToLog = true, $sFakeRaw = '')
 {
     if ($this->bUnreadBuffer) {
         $this->writeLogException(new Exceptions\SocketUnreadBufferException(), \MailSo\Log\Enumerations\Type::ERROR, true);
     }
     $bFake = 0 < \strlen($sFakeRaw);
     $sRaw .= "\r\n";
     if ($this->oLogger && $this->oLogger->IsShowSecter()) {
         $bFake = false;
     }
     if ($bFake) {
         $sFakeRaw .= "\r\n";
     }
     $mResult = @\fwrite($this->rConnect, $sRaw);
     if (false === $mResult) {
         $this->IsConnected(true);
         $this->writeLogException(new Exceptions\SocketWriteException(), \MailSo\Log\Enumerations\Type::ERROR, true);
     } else {
         \MailSo\Base\Loader::IncStatistic('NetWrite', $mResult);
         if ($bWriteToLog) {
             $this->writeLogWithCrlf('> ' . ($bFake ? $sFakeRaw : $sRaw), $bFake ? \MailSo\Log\Enumerations\Type::SECURE : \MailSo\Log\Enumerations\Type::INFO);
         }
     }
 }