Added a paragraph about time-out handler factory.
This commit is contained in:
parent
b79a6ad890
commit
5929fb4b36
@ -726,6 +726,30 @@ private:
|
|||||||
};
|
};
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
|
To make the service use your time-out handler, you need to write a factory
|
||||||
|
class, to allow the service to create instances of the handler class. This
|
||||||
|
is required because the service can use several connections to the server
|
||||||
|
simultaneously, and each connection needs its own time-out handler.
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
class myTimeoutHandlerFactory : public vmime::net::timeoutHandlerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
ref <timeoutHandler> create()
|
||||||
|
{
|
||||||
|
return vmime::create <myTimeoutHandler>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
Then, call the {\vcode setTimeoutHandlerFactory()} method on the service object
|
||||||
|
to set the time-out handler factory to use during the session:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
theService->setTimeoutHandlerFactory(vmime::create <myTimeoutHandlerFactory>());
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
|
||||||
% ============================================================================
|
% ============================================================================
|
||||||
\newpage
|
\newpage
|
||||||
@ -812,7 +836,7 @@ issuer, and so on.
|
|||||||
To decide whether the server can be trusted or not, you have to verify that
|
To decide whether the server can be trusted or not, you have to verify that
|
||||||
\emph{each} certificate is valid (ie. is trusted). For more information
|
\emph{each} certificate is valid (ie. is trusted). For more information
|
||||||
about X.509 and certificate verification, see related articles on Wikipedia
|
about X.509 and certificate verification, see related articles on Wikipedia
|
||||||
\footnote{\url{See http://wikipedia.org/wiki/Public\_key\_certificate}}.
|
\footnote{See \url{http://wikipedia.org/wiki/Public\_key\_certificate}}.
|
||||||
|
|
||||||
\subsubsection{Using the default certificate verifier} % .....................
|
\subsubsection{Using the default certificate verifier} % .....................
|
||||||
|
|
||||||
@ -944,3 +968,9 @@ public:
|
|||||||
about which certificates to trust and which not. See {\vexample Example6} for
|
about which certificates to trust and which not. See {\vexample Example6} for
|
||||||
a basic cache implementation.}
|
a basic cache implementation.}
|
||||||
|
|
||||||
|
Finally, to make the service use your own certificate verifier, simply write:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
theService->setCertificateVerifier(vmime::create <myCertVerifier>());
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user