<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="eventbufferevent.sslerror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>EventBufferEvent::sslError</refname>
  <refpurpose>Returns most recent OpenSSL error reported on the buffer event</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier>
   <type>string</type>
   <methodname>EventBufferEvent::sslError</methodname>
   <void />
  </methodsynopsis>
  <para>
   Returns most recent OpenSSL error reported on the buffer event.
  </para>
  <note>
   <para>
    This function is available only if
    <literal>Event</literal>
    is compiled with OpenSSL support.
   </para>
  </note>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns OpenSSL error string reported on the buffer event, or &false;, if
   there is no more error to return.
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title>
    <function>EventBufferEvent::sslError</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php
// This callback is invoked when some even occurs on the event listener,
// e.g. connection closed, or an error occurred
function ssl_event_cb($bev, $events, $ctx) {
    if ($events & EventBufferEvent::ERROR) {
        // Fetch errors from the SSL error stack
        while ($err = $bev->sslError()) {
            fprintf(STDERR, "Bufferevent error %s.\n", $err);
        }
    }

    if ($events & (EventBufferEvent::EOF | EventBufferEvent::ERROR)) {
        $bev->free();
    }
}
?>
]]>
   </programlisting>
  </example>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member>
    <methodname>EventBufferEvent::sslRenegotiate</methodname>
   </member>
  </simplelist>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
