/** * @param string $data * @throws IOException */ public function write($data) { if (null !== $this->encryptor) { $data = $this->encryptor->encrypt($data); } $result = @fputs($this->connection, $data); if (false === $result) { throw new IOException($this->__toString() . " " . $data); } }
protected final function _write($data) { if (null !== $this->encryptor) { $data = $this->encryptor->encrypt($data); } $result = @fputs($this->connection, $data); if (false === $result) { throw new \Socket\Exception\IOException($this->toString() . "\n" . $data); } }