\doxysection{Qore\+::Socket Class Reference}
\hypertarget{class_qore_1_1_socket}{}\label{class_qore_1_1_socket}\index{Qore::Socket@{Qore::Socket}}


The \doxylink{class_qore_1_1_socket}{Socket} class allows Qore programs safe access to network sockets.  




{\ttfamily \#include $<$QC\+\_\+\+Socket.\+dox.\+h$>$}



Inheritance diagram for Qore\+::Socket\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=214pt]{class_qore_1_1_socket__inherit__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_socket}{Socket}} \mbox{\hyperlink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{accept}} ()
\begin{DoxyCompactList}\small\item\em Accepts connections on a listening socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} \mbox{\hyperlink{class_qore_1_1_socket_a44c6610f3e6ed41cccd4a69450298acf}{accept}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}})
\begin{DoxyCompactList}\small\item\em Accepts connections on a listening socket (see \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}) accepting a timeout value with a millisecond resolution. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db}{accept\+All\+Certificates}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{accept\+\_\+all}}=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em with peer verification enabled, all certificates are accepted regardless of the validity of the Certificate Authority \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket}{Socket}} \mbox{\hyperlink{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}{accept\+SSL}} ()
\begin{DoxyCompactList}\small\item\em Accepts connections on a listening socket and attempts to negotiate a TLS/\+SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} \mbox{\hyperlink{class_qore_1_1_socket_a6955fcbdc09f8e24636ae0f6103e2eb7}{accept\+SSL}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}})
\begin{DoxyCompactList}\small\item\em Accepts connections on a listening socket and attempts to negotiate a TLS/\+SSL connection accepting a timeout value with a millisecond resolution. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{bind}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reuseaddr}}=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}})
\begin{DoxyCompactList}\small\item\em Opens and binds the socket to a port, interface and port (if the bind\+\_\+to string has a format "{}host\+:port"{}), or UNIX domain socket file. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a801a23bb93b9104179c211f6704bc1de}{bind}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} port, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reuseaddr}}=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}})
\begin{DoxyCompactList}\small\item\em Opens and binds the socket to an INET port on all interfaces. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7}{bind\+INET}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{iface}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{service}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reuseaddr}}=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} family=\mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Opens and binds the socket to the given IPv4 or IPv6 interface (or if no interface is given, then to all interfaces on the local system) and port (the port number will be derived from the service name if a numeric port number is not given) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f}{bind\+UNIX}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Opens and binds the socket to the given UNIX domain socket file as given by the filename argument. If any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a1f13f8ff6573368f167cb65480302c5a}{capture\+Remote\+Certificates}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} set=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Sets the flag for capturing remote X.\+509 certificates; by default no capture of remote certificates is performed. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aa11d890255025ccbbf02ff26724b282c}{clear\+Stats}} ()
\begin{DoxyCompactList}\small\item\em Clears performance statistics. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a9879dc24c43dbc9784386e36f1c2425b}{clear\+Warning\+Queue}} ()
\begin{DoxyCompactList}\small\item\em Removes any warning \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object from the \doxylink{class_qore_1_1_socket}{Socket}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a40deec9f0ac1abcfca999b9592bed0ee}{close}} ()
\begin{DoxyCompactList}\small\item\em Closes an open socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{connect}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{target}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Connects to a remote port (if the string has a format "{}host\+:port"{}) or UNIX domain socket file. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}{connect\+INET}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} host, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{service}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} family=\mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Connects to the given host and port with an optional timeout value with a millisecond resolution. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{connect\+INETSSL}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} host, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{service}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} family=\mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Connects to the given host and port and attempts to establish a TLS/\+SSL connection; accepts an optional timeout value with a millisecond resolution. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{connect\+SSL}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{target}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Connects to a remote socket and attempts to establish a TLS/\+SSL connection; accepts an optional timeout value with a millisecond resolution. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{connect\+UNIX}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Connects to a UNIX domain socket file. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{connect\+UNIXSSL}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{socktype}}=\mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} protocol=0)
\begin{DoxyCompactList}\small\item\em Connects to the given UNIX domain socket file and attempts to establish a TLS/\+SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aae2f017c8bf867f2380c2dbc873af465}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Creates the socket object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aa91f15de558a8ca27680cef49bb508ad}{copy}} ()
\begin{DoxyCompactList}\small\item\em Creates a new \doxylink{class_qore_1_1_socket}{Socket} object, not based on the source being copied. \end{DoxyCompactList}\item 
\Hypertarget{class_qore_1_1_socket_af7351a51a2a36ddc503c406acb33fc2a}\label{class_qore_1_1_socket_af7351a51a2a36ddc503c406acb33fc2a} 
{\bfseries destructor} ()
\begin{DoxyCompactList}\small\item\em Deletes the object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9}{get\+Accept\+All\+Certificates}} ()
\begin{DoxyCompactList}\small\item\em returns the current value of the "{}accept all certificates"{} flag \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_afbf2522548202dfc71cea1584bcda764}{get\+Charset}} ()
\begin{DoxyCompactList}\small\item\em Returns the \doxylink{character_encoding}{character encoding} for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a6f38a1974f2b791805d9a1793c073adf}{get\+Connection\+Id}} ()
\begin{DoxyCompactList}\small\item\em Returns an integer connection ID that is incremented every time the socket is disconnected. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_acd67aa33bbd8eefa5b557ae16a7bdecf}{get\+Encoding}} ()
\begin{DoxyCompactList}\small\item\em Returns the \doxylink{character_encoding}{character encoding} for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a3cbc1223bd9cba7d58052febd5e92dab}{get\+No\+Delay}} ()
\begin{DoxyCompactList}\small\item\em Returns the {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{get\+Peer\+Info}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{host\+\_\+lookup}}=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Returns a \doxylink{class_qore_1_1_socket_socket_info_hash}{hash of information} about the remote end for connected sockets. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ae5077a1a1be1ce30a5251be59d760751}{get\+Port}} ()
\begin{DoxyCompactList}\small\item\em Returns the port number of the socket for INET sockets. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a9d6ede847e9d88b25eb3fea209fcbe3a}{get\+Recv\+Timeout}} ()
\begin{DoxyCompactList}\small\item\em Returns the receive timeout socket option value as an integer in milliseconds. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}} \mbox{\hyperlink{class_qore_1_1_socket_a71487cf967828b884ba41ad30ff4bda1}{get\+Remote\+Certificate}} ()
\begin{DoxyCompactList}\small\item\em Returns any remote certificate captured or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if there is none. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_a416283c6332e611607ee2aa4b2a9cad4}{get\+SSLCipher\+Name}} ()
\begin{DoxyCompactList}\small\item\em Returns the name of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_a47aae073c822eb9ac197b9befde75a9d}{get\+SSLCipher\+Version}} ()
\begin{DoxyCompactList}\small\item\em Returns the version string of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a037f1e937dba99b785dc846799f479b6}{get\+Send\+Timeout}} ()
\begin{DoxyCompactList}\small\item\em Returns the send timeout socket option value as an integer in milliseconds. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a287387be61ed857ad44f9fa79ad4292c}{get\+Socket}} ()
\begin{DoxyCompactList}\small\item\em Returns the socket file descriptor number. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a2b2e555609f4a7c98813f91d6109fb90}{get\+Socket\+Info}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{host\+\_\+lookup}}=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Returns information about the local socket as a hash. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5}{get\+Ssl\+Verify\+Mode}} ()
\begin{DoxyCompactList}\small\item\em returns the current SSL verification mode \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a528fa7341e599d9f14aa6bbe96356e3c}{get\+Usage\+Info}} ()
\begin{DoxyCompactList}\small\item\em Returns performance statistics for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_ada15658191958a262a3c8ca44160f112}{is\+Data\+Available}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=0)
\begin{DoxyCompactList}\small\item\em Returns \doxysectlink{basic_data_types_True}{True}{2} or \doxysectlink{basic_data_types_False}{False}{2} depending on whether there is data to be read on the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a1f6e97d05075accded9da7a8ee44defd}{is\+Open}} ()
\begin{DoxyCompactList}\small\item\em Returns \doxysectlink{basic_data_types_True}{True}{2} if the socket is open. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a62f88e568207417db77890f565063822}{is\+Secure}} ()
\begin{DoxyCompactList}\small\item\em Returns \doxysectlink{basic_data_types_True}{True}{2} if the connection is a secure TLS/\+SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a57f1ae016aa33f5ba449a99a8f7f6cc0}{is\+Write\+Finished}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=0)
\begin{DoxyCompactList}\small\item\em Returns \doxysectlink{basic_data_types_True}{True}{2} or \doxysectlink{basic_data_types_False}{False}{2} depending on whether all the data has been written to the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{listen}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{backlog}}=20)
\begin{DoxyCompactList}\small\item\em Listens for connections on a bound socket; sets the socket in a listening state. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{class_qore_1_1_socket_a16039558967b42619176a9609bce5399}{pending\+Http\+Chunked\+Body}} ()
\begin{DoxyCompactList}\small\item\em returns True if the socket is still connected, and a HTTP header was read indicating chunked transfer encoding, but no chunked body has been read yet \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a440e92d904b546fa1cbd40ce4f36e564}{read\+HTTPChunk}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in a single HTTP message chunk. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a60ccf4dbef8657272a09a6003dfc2410}{read\+HTTPChunked\+Body}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a09f29e987023ebf27d6edd8fd2aa3bc9}{read\+HTTPChunked\+Body\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a binary object in the {\ttfamily "{}body"{}} key of a hash (including footers received) \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aa3c8f41a0879b440a999db5c55663d30}{read\+HTTPChunked\+Body\+Binary\+With\+Callback}} (code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{rcb}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a66e68401a9f1593a2580a0d25e491f2e}{read\+HTTPChunked\+Body\+To\+Output\+Stream}} (\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{os}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in an HTTP message body sent in chunked transfer encoding, writes it in an \doxylink{class_qore_1_1_output_stream}{Output\+Stream} and returns any footers received. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_a97ffc465250c06c5b4fbc512bd17ee64}{read\+HTTPChunked\+Body\+With\+Callback}} (code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{rcb}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}{read\+HTTPHeader}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info)
\begin{DoxyCompactList}\small\item\em Retuns a hash representing the data in the HTTP header read, or, if the data cannot be parsed as an HTTP header, then an exception is thrown, and the data read is returned as a string in the {\ttfamily arg} key of the exception hash. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_ac3e0f0383c3337783a49ff85d8805bad}{read\+HTTPHeader\+String}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Retuns a string representing the data in the HTTP header read (reads until {\ttfamily "{}\textbackslash{}r\textbackslash{}n\textbackslash{}r\textbackslash{}n"{}}) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a813896d93e94d548d18f1c5128d345a0}{read\+Server\+Sent\+Event}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{content\+\_\+encoding}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Read a server sent event message. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_aeaadf2a4de58c22d15b6a277fdc49ce8}{read\+Server\+Sent\+Event}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Read a server sent event message. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} size=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives data from the socket and returns a string tagged with the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s character encoding. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{class_qore_1_1_socket_aa255d1dcfbddb208e80684eebecc800d}{recv\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} size=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives data from the socket and returns a binary object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a94c526792b88115ab62bdfa26a7ec48f}{recv\+To\+Output\+Stream}} (\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{os}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} size=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives data from the socket and writes the bytes to an \doxylink{class_qore_1_1_output_stream}{Output\+Stream}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a9c362b07b1d06fce22bde3e6a888832d}{recvi1}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 1-\/byte signed integer from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738}{recvi2}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 2-\/byte (16-\/bit) signed integer in big-\/endian format (network byte order) from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12}{recvi2\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 2-\/byte (16-\/bit) signed integer in little-\/endian format from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea}{recvi4}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 4-\/byte (32-\/bit) signed integer in big-\/endian format (network byte order) from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c}{recvi4\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 4-\/byte (32-\/bit) signed integer in little-\/endian format from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_adc8295d79e2288b2e8c5143ac270d08c}{recvi8}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives an 8-\/byte (64-\/bit) signed integer in big-\/endian format (network byte order) from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a7d107840ba3dbac1bd621179a89b121a}{recvi8\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives an 8-\/byte (64-\/bit) signed integer in little-\/endian format from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ab77e7118003c6ae4baac594ffd91d980}{recvu1}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 1-\/byte unsigned integer from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e}{recvu2}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 2-\/byte (16-\/bit) unsigned integer in big-\/endian format (network byte order) from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0}{recvu2\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 2-\/byte (16-\/bit) unsigned integer in little-\/endian format from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14}{recvu4}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 4-\/byte (32-\/bit) unsigned integer in big-\/endian format (network byte order) from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a}{recvu4\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Receives a 4-\/byte (32-\/bit) unsigned integer in little-\/endian format from the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bin}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends binary data over the socket; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aa2fbea3740e4195c06f78e35f36da966}{send}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends string data over the socket; string data is converted to the socket\textquotesingle{}s encoding if necessary; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{send2}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bin}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends binary data over the socket; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a023cbc8f4aae2e34364d3df6930fa220}{send2}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends string data over the socket; string data is converted to the socket\textquotesingle{}s encoding if necessary; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9}{send\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends string data over the socket without converting the string to the socket\textquotesingle{}s encoding, but instead is sent exactly as-\/is; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a0e80d3a58b2e82f3620c06fec63db05f}{send\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bin}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends binary data over the socket; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{send\+Binary2}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends string data over the socket without converting the string to the socket\textquotesingle{}s encoding, but instead is sent exactly as-\/is; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a87dc2b71ee071f8d76a96cd4a4092e21}{send\+Binary2}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bin}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends binary data over the socket; if any errors occur, an exception is thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a405089a14054f20f9c1a7132bc2873bc}{send\+From\+Input\+Stream}} (\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{input\+\_\+stream}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} size=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads data from an \doxylink{class_qore_1_1_input_stream}{Input\+Stream} and sends the bytes over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_af9d1cff50c37b6a92b6ce60357f3593c}{send\+HTTPChunked\+Body\+From\+Input\+Stream}} (\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{input\+\_\+stream}}, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{max\+\_\+chunk\+\_\+size}}=4096, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{tcb}})
\begin{DoxyCompactList}\small\item\em Sends an HTTP message body in chunked transfer encoding. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ad4350c9346e37d5f9ece9578718efd6c}{send\+HTTPChunked\+Body\+Trailer}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{trailer}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends the trialer of an HTTP message body in chunked transfer encoding. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_adf437ed165c08a1d166756ebe7b5ed4d}{send\+HTTPMessage}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{method}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}} $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a1124aa106dc7585c0e2e18860e1c420d}{send\+HTTPMessage}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{method}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_aad057db5dddad2562a8c09a6cf0af543}{send\+HTTPMessage\+With\+Callback}} (code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{scb}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{method}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d}{send\+HTTPResponse}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and an optional message body. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_af93b262da988c84136afe94cab278a14}{send\+HTTPResponse}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and an optional message body. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ae615dc93d0c645f351a843cee7249ada}{send\+HTTPResponse}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and a message body as literal binary data. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a15dd0f366b67539f2bed19ec4d36e87d}{send\+HTTPResponse}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{body}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and a message body as literal binary data. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a85f188ec83afbfb2068d742092f58042}{send\+HTTPResponse}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{input\+\_\+stream}}, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{max\+\_\+chunk\+\_\+size}}=4096, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{tcb}})
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers and a message body from an input stream in chunked transfer encoding. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a43ee02b46ffe20bc219a65c72944386f}{send\+HTTPResponse\+With\+Callback}} (code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{scb}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and a message body to send with chunked transfer encoding provided by a callback. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a5f5a90c335a060f916e3196810b60195}{send\+HTTPResponse\+With\+Callback}} (code \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{scb}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+code}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{status\+\_\+desc}}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{http\+\_\+version}}, \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{headers}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$ info, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an HTTP response with user-\/defined headers given as a hash and a message body to send with chunked transfer encoding provided by a callback. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a13a4582d75efdb29305b1b54bf66b31b}{sendi1}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends a 1-\/byte integer over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aaa62ba419d66dac29d8605c6dd5a7e68}{sendi2}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends a 2-\/byte (16-\/bit) integer in big-\/endian format (network byte order) over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a0139b7e63ce4d06edecdb96d64124511}{sendi2\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends a 2-\/byte (16-\/bit) integer in little-\/endian format over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a88a630d0cda97256c4b01c1e8b71d6e3}{sendi4}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends a 4-\/byte (32-\/bit) integer in big-\/endian format (network byte order) over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a69c50668b38e98af23ab9fb07ce9adff}{sendi4\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends a 4-\/byte (32-\/bit) integer in little-\/endian format over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a8820f3ae73f1ce737aaf88b9cfb3c001}{sendi8}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an 8-\/byte (64-\/bit) integer in big-\/endian format (network byte order) over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a142489a333f9444b7379ad5b2a365780}{sendi8\+LSB}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{i}}=0, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Sends an 8-\/byte (64-\/bit) integer in little-\/endian format over the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a9635916d0570c939002ab206cb0f52de}{set\+Certificate}} (\mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{cert}})
\begin{DoxyCompactList}\small\item\em Sets the X.\+509 certificate to use for negotiating encrypted connections. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_aa0fe25d00f6907cfa98612c9ff2b62c6}{set\+Certificate}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{cert\+\_\+pem}})
\begin{DoxyCompactList}\small\item\em Sets the X.\+509 certificate to use for negotiating encrypted connections from the PEM-\/encoded string representing the X.\+509 certificate. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a3f7bfccfea1d522e64e2e5a959d0abba}{set\+Certificate}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{cert\+\_\+der}})
\begin{DoxyCompactList}\small\item\em Sets the X.\+509 certificate to use for negotiating encrypted connections from the DER-\/encoded binary object representing the X.\+509 certificate. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a5cc870765d200c1b3df7c639db47885e}{set\+Certificate\+And\+Private\+Key}} (\mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{cert}}, \mbox{\hyperlink{class_qore_1_1_s_s_l_private_key}{SSLPrivate\+Key}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{key}})
\begin{DoxyCompactList}\small\item\em Sets the X.\+509 certificate and private key in one atomic operation to use for negotiating encrypted connections. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ad5685173c314f4d5905b6d6ce4487479}{set\+Charset}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding)
\begin{DoxyCompactList}\small\item\em Sets the \doxylink{character_encoding}{character encoding} for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4}{set\+Encoding}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding)
\begin{DoxyCompactList}\small\item\em Sets the \doxylink{character_encoding}{character encoding} for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ad1259b25b8b8533d042a1f7bc29894b1}{set\+Event\+Queue}} ()
\begin{DoxyCompactList}\small\item\em Removes any \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object from the \doxylink{class_qore_1_1_socket}{Socket} object so that \doxylink{class_qore_1_1_socket_socket_events}{socket events} are no longer added to the \doxylink{class_qore_1_1_thread_1_1_queue}{Queue}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ab639fa7679cf964790d69773512eb7c7}{set\+Event\+Queue}} (\mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Qore\+::\+Thread\+::\+Queue}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{queue}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} arg, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{with\+\_\+data}})
\begin{DoxyCompactList}\small\item\em Sets a \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive \doxylink{class_qore_1_1_socket_socket_events}{socket events}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_ada4d53ed63a5df3ec798153a3caf65d1}{set\+No\+Delay}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nd}}=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Sets the boolean {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_af7ae2ef7cc4202e68f356deda71369e9}{set\+Private\+Key}} (\mbox{\hyperlink{class_qore_1_1_s_s_l_private_key}{SSLPrivate\+Key}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{key}})
\begin{DoxyCompactList}\small\item\em Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a82fa4152827ee55c14e3e8ef5b7fbbbc}{set\+Private\+Key}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{key\+\_\+pem}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{pass}})
\begin{DoxyCompactList}\small\item\em Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate from a PEM-\/encoded string representing the private key and an optional password. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_aa7a28fc5c83ff2be97010d8ae2f48389}{set\+Private\+Key}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{key\+\_\+der}})
\begin{DoxyCompactList}\small\item\em Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate from a DER-\/encoded binary object representing the private key. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_a314c17ae30d7e1b0cea515e6519734b1}{set\+Recv\+Timeout}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}})
\begin{DoxyCompactList}\small\item\em sets the receive timeout as a socket option \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aa88886547e8d064bee7c2e16f266c42c}{set\+Send\+Timeout}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}})
\begin{DoxyCompactList}\small\item\em sets the send timeout as a socket option \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac}{set\+Ssl\+Verify\+Mode}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} mode)
\begin{DoxyCompactList}\small\item\em sets the SSL verification mode \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{set\+Warning\+Queue}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{warning\+\_\+ms}}, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{warning\+\_\+bs}}, Queue \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{queue}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} arg, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{min\+\_\+ms}}=1\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{s}})
\begin{DoxyCompactList}\small\item\em Sets a \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive socket warnings. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_socket_aab67c1ece890cdf79359ba56f1cd2731}{shutdown}} ()
\begin{DoxyCompactList}\small\item\em Ensures that a socket will be closed even if the file descriptor is shared with other processes (for example, after a call to \doxylink{group__library__functions_ga38309c0ab1c849afc031dd8547b1ac65}{fork()}) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ab2d2bda62f69f0d6da4fb6907a549562}{shutdown\+SSL}} ()
\begin{DoxyCompactList}\small\item\em Shuts down the SSL connection on a secure connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a1d17452b2ef1ecc9c3ca4a06b17e2f19}{start\+Poll\+Accept}} ()
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to accept a new connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a7625085604b489d486a0d4f4b6041a51}{start\+Poll\+Connect}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{target}})
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for a standard connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a2b3b316ddfb1a70a75b851c6f26a3e84}{start\+Poll\+Connect\+Ssl}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{target}})
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for an SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_adf42019305419e0a2648a3172d055108}{start\+Poll\+Read\+Http\+Header}} ()
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read an HTTP header without blocking. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a412684112cb6ae24b0034e3f1688893a}{start\+Poll\+Recv\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} size)
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_af7d76d0129b493c5c104970ab7e6aac5}{start\+Poll\+Recv\+Data}} ()
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object for receiving data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_aa5c1b3f7285d859333fcf9341412f6b6}{start\+Poll\+Recv\+String}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} size)
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_ab5d2a9a08f8e4927646bcc214ec7344e}{start\+Poll\+Recv\+Until\+Bytes\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{pattern}})
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a857e24f03cdb6c88b5cd56030aaf9a53}{start\+Poll\+Recv\+Until\+Bytes\+String}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{pattern}})
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_ab9c5faba4df243b31ed97d3771a7f818}{start\+Poll\+Send}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} data)
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a9053ac6a07bb482ef0bc8bdb9368d6e6}{start\+Poll\+Send}} (\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} data)
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_a66708f1d0cc7ba38051884e4b19b0351}{start\+Poll\+Upgrade\+Client\+To\+SSL}} ()
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected client socket to SSL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} \mbox{\hyperlink{class_qore_1_1_socket_aaafb534070e81b96e251c643684806e7}{start\+Poll\+Upgrade\+Server\+To\+SSL}} ()
\begin{DoxyCompactList}\small\item\em Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected server socket to SSL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_ad471f7399655c3fb211c72b55ca568d9}{upgrade\+Client\+To\+SSL}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Upgrades a client socket connection to a TLS/\+SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_socket_a83385d31d5b112409424269f025de5ea}{upgrade\+Server\+To\+SSL}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}}=-\/1)
\begin{DoxyCompactList}\small\item\em Upgrades a server socket connection to a TLS/\+SSL connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_socket_a601f1a0515d127d2cca2b4febdb40d31}{verify\+Peer\+Certificate}} ()
\begin{DoxyCompactList}\small\item\em Returns a string code giving the result of verifying the remote certificate or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if an encrypted connection is not currently established. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_qore_1_1_abstract_pollable_io_object_base}{Qore\+::\+Abstract\+Pollable\+Io\+Object\+Base}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_abstract_pollable_io_object_base_a772a2dc97dddb19a647ccdc863068d57}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Throws an exception; this class is not usable by Qore classes. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_abstract_pollable_io_object_base_aa56f7bc79f6a71cd6f4da811dc18e591}{get\+Pollable\+Descriptor}} ()
\begin{DoxyCompactList}\small\item\em Returns a pollable file / socket / I/O descriptor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_qore_1_1_abstract_pollable_io_object}{Qore\+::\+Abstract\+Pollable\+Io\+Object}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{abstract}} \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_abstract_pollable_io_object_a3223f412f1d590a87f71d2d0656edc62}{get\+Pollable\+Descriptor}} ()
\begin{DoxyCompactList}\small\item\em Returns a pollable file / socket / I/O descriptor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{static}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_socket_a633193d68c0342b2311dac2e5ee6ddfb}{parse\+Server\+Sent\+Event}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{str}})
\begin{DoxyCompactList}\small\item\em Parse the given string as a Server Sent Event (SSE) string. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{static}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_socket_poll_info}{Socket\+Poll\+Info}} $>$ $>$ \mbox{\hyperlink{class_qore_1_1_socket_a44c1f81d7797e383a37d1cbd788329e8}{poll}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_socket_poll_info}{Socket\+Poll\+Info}} $>$ $>$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{items}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout\+\_\+ms}})
\begin{DoxyCompactList}\small\item\em polls multiple sockets and returns all sockets with events \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \doxylink{class_qore_1_1_socket}{Socket} class allows Qore programs safe access to network sockets. 

\begin{DoxyParagraph}{Restrictions\+:}
\doxylink{group__parse__options_ga20400e83c6271a294a48b15a8f952efa}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+NETWORK}
\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This class is not available with the \doxylink{group__parse__options_ga20400e83c6271a294a48b15a8f952efa}{PO\+\_\+\+NO\+\_\+\+NETWORK} parse option.
\end{DoxyNote}
Non-\/blocking socket I/O can be performed by appending a timeout value in milliseconds all \doxylink{class_qore_1_1_socket}{Socket} methods performing I/O operations, or by using the \doxylink{class_qore_1_1_socket_ada15658191958a262a3c8ca44160f112}{Socket\+::is\+Data\+Available()} method with a timeout value in milliseconds (1000 ms = 1 second). Note that as with all Qore functions and methods accepting a timeout value, relative date/time values can be given instead of integers to make the source more readable, for example\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ rc\ =\ socket.isDataAvailable(1250ms);\ \textcolor{comment}{\#\ times\ out\ in\ 1.25\ seconds}}

\end{DoxyCode}


\doxylink{class_qore_1_1_socket}{Socket} objects can automatically convert character encodings if desired when sending string data with \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{Socket\+::send()}. Use the \doxylink{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4}{Socket\+::set\+Encoding()} method to set the character encoding for the socket. If a character encoding is set, and string data is read with the \doxylink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{Socket\+::recv()} method, then it will be tagged with the encoding of the socket as well.

Client applications should call \doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()} to connect to a remote port or a UNIX domain socket (socket file on the local server). However, if the remote end is expecting a TLS/\+SSL connection, use \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()} instead.

Server applications should call \doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{Socket\+::bind()}, \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}, and \doxylink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{Socket\+::accept()} in this order to accept incoming connections. Normally a new thread should be started after the \doxylink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{Socket\+::accept()} call to handle the new connection in a separate thread (\doxylink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{Socket\+::accept()} returns a new \doxylink{class_qore_1_1_socket}{Socket} object for the accepted connection).

To support TLS/\+SSL server connections, first set the certificate and private key with the \doxylink{class_qore_1_1_socket_a9635916d0570c939002ab206cb0f52de}{Socket\+::set\+Certificate()} and \doxylink{class_qore_1_1_socket_af7ae2ef7cc4202e68f356deda71369e9}{Socket\+::set\+Private\+Key()} methods (see the \doxylink{class_qore_1_1_s_s_l_certificate}{SSLCertificate} Class and the \doxylink{class_qore_1_1_s_s_l_private_key}{SSLPrivate\+Key} Class for more information on the parameters required for these methods). Then \doxylink{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}{Socket\+::accept\+SSL()} should be called after the socket is in a listening state to accept client connections and negotiate a TLS/\+SSL connection.

This class supports posting events to a \doxylink{class_qore_1_1_thread_1_1_queue}{Queue}. See \doxylink{event_handling}{I/O Event Handling} for more information.

The events raised by this object are listed in the following table\+:

\label{class_qore_1_1_socket_socket_events}%
\Hypertarget{class_qore_1_1_socket_socket_events}%
 {\bfseries{\doxylink{class_qore_1_1_socket}{Socket} Events}}  \tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries{Name}} &{\bfseries{Description}}  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1} &Raised when a network packet is received.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1} &Raised when a network packet is sent.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_CHANNEL_CLOSED}{EVENT\+\_\+\+CHANNEL\+\_\+\+CLOSED}{1} &Raised when a socket is closed.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_DELETED}{EVENT\+\_\+\+DELETED}{1} &Raised when the object being monitored is deleted.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_HOSTNAME_LOOKUP}{EVENT\+\_\+\+HOSTNAME\+\_\+\+LOOKUP}{1} &Raised when a hostname lookup is attempted.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_HOSTNAME_RESOLVED}{EVENT\+\_\+\+HOSTNAME\+\_\+\+RESOLVED}{1} &Raised when a hostname lookup is resolved.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1} &Raised when an HTTP message is sent.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+MESSAGE\+\_\+\+RECEIVED}{1} &Raised when an HTTP message is received.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1} &Raised right before a socket connection attempt is made.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1} &Raised when the socket connection has been established.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_START_SSL}{EVENT\+\_\+\+START\+\_\+\+SSL}{1} &Raised when socket SSL negotiation starts.  \\\cline{1-2}
\doxysectlink{event_handling_EVENT_SSL_ESTABLISHED}{EVENT\+\_\+\+SSL\+\_\+\+ESTABLISHED}{1} &Raised when SSL communication has been negotiated and established.  \\\cline{1-2}
\end{longtabu}


\label{class_qore_1_1_socket_socket_info_hash}%
\Hypertarget{class_qore_1_1_socket_socket_info_hash}%
 {\bfseries{\doxylink{class_qore_1_1_socket}{Socket} Information Hash}}  \tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries{Key}} &{\bfseries{Description}}  \\\cline{1-2}
{\ttfamily hostname}  &The interface name if available (ex\+: {\ttfamily "{}localhost"{}}; note that this key is not present when retrieving information about UNIX sockets)  \\\cline{1-2}
{\ttfamily hostname\+\_\+desc}  &A descriptive string giving the hostname and the address family if the hostname is available (ex\+: {\ttfamily "{}ipv6\mbox{[}localhost\mbox{]}"{}}; note that this key is not present when retrieving information about UNIX sockets)  \\\cline{1-2}
{\ttfamily address}  &A string giving the address (ex\+: {\ttfamily "{}\+::ffff\+:0.\+0.\+0.\+0"{}})  \\\cline{1-2}
{\ttfamily address\+\_\+desc}  &A descriptive string giving the address and the address family (ex\+: {\ttfamily "{}ipv6\mbox{[}\+::ffff\+:0.\+0.\+0.\+0\mbox{]}"{}})  \\\cline{1-2}
{\ttfamily port}  &An integer port number if available (note that this key is not present when retrieving information about UNIX sockets)  \\\cline{1-2}
{\ttfamily family}  &The network address family (see \doxylink{group__network__address__family__constants}{Network Address Family Constants})  \\\cline{1-2}
{\ttfamily familystr}  &A string describing the network address family (ex\+: {\ttfamily "{}ipv4"{}})  \\\cline{1-2}
\end{longtabu}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}\label{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57} 
\index{Qore::Socket@{Qore::Socket}!accept@{accept}}
\index{accept@{accept}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{accept()}{accept()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} Qore\+::\+Socket\+::accept (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Accepts connections on a listening socket. 

Accepts connections on a listening socket; if any errors occur, an exception is thrown.

The new \doxylink{class_qore_1_1_socket}{Socket} object returned will have the same character encoding as the current object. Once a new connection has been accepted, call \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} to get information about the remote socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Socket\ new\_socket\ =\ sock.accept();\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a new \doxylink{class_qore_1_1_socket}{Socket} object is returned for the new connection
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not bound \\
\hline
{\em SOCKET-\/\+ACCEPT-\/\+ERROR} & Error in accepting connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}{Socket\+::accept\+SSL()}, \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}, \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a44c6610f3e6ed41cccd4a69450298acf}\label{class_qore_1_1_socket_a44c6610f3e6ed41cccd4a69450298acf} 
\index{Qore::Socket@{Qore::Socket}!accept@{accept}}
\index{accept@{accept}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{accept()}{accept()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} Qore\+::\+Socket\+::accept (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms }\end{DoxyParamCaption})}



Accepts connections on a listening socket (see \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}) accepting a timeout value with a millisecond resolution. 

If any errors occur, an exception is thrown.

The new \doxylink{class_qore_1_1_socket}{Socket} object returned will have the same character encoding as the current object. Once a new connection has been accepted, call \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} to get information about the remote socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*Socket\ new\_socket\ =\ sock.accept(30s);\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & If a timeout value is passed and the connection takes longer to establish than the timeout, then \doxysectlink{basic_data_types_nothing}{NOTHING}{1} is returned.\+Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
If no connection is accepted within the timeout period, then \doxysectlink{basic_data_types_nothing}{NOTHING}{1} is returned, otherwise a \doxylink{class_qore_1_1_socket}{Socket} object for the new connection is returned.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not bound \\
\hline
{\em SOCKET-\/\+ACCEPT-\/\+ERROR} & Error in accepting connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}{Socket\+::accept\+SSL()}, \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}, \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db}\label{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db} 
\index{Qore::Socket@{Qore::Socket}!acceptAllCertificates@{acceptAllCertificates}}
\index{acceptAllCertificates@{acceptAllCertificates}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{acceptAllCertificates()}{acceptAllCertificates()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::accept\+All\+Certificates (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{accept\+\_\+all = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



with peer verification enabled, all certificates are accepted regardless of the validity of the Certificate Authority 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{\#\ require\ a\ certificate\ from\ the\ peer,\ but\ accept\ all\ certificates,\ even\ self-\/signed\ ones}}
\DoxyCodeLine{sock.setSslVerifyMode(SSL\_VERIFY\_PEER|SSL\_VERIFY\_FAIL\_IF\_NO\_PEER\_CERT);}
\DoxyCodeLine{sock.acceptAllCertificates();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em accept\+\_\+all} & if \doxysectlink{basic_data_types_True}{True}{2}, then self-\/signed certificates are accepted, if \doxysectlink{basic_data_types_False}{False}{2}, then they are not\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9}{Socket\+::get\+Accept\+All\+Certificates()}
\item \doxylink{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac}{Socket\+::set\+Ssl\+Verify\+Mode()}
\item \doxylink{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5}{Socket\+::get\+Ssl\+Verify\+Mode()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}\label{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690} 
\index{Qore::Socket@{Qore::Socket}!acceptSSL@{acceptSSL}}
\index{acceptSSL@{acceptSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{acceptSSL()}{acceptSSL()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} Qore\+::\+Socket\+::accept\+SSL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Accepts connections on a listening socket and attempts to negotiate a TLS/\+SSL connection. 

Accepts connections on a listening socket and attempts to negotiate a TLS/\+SSL connection; if any errors occur, an exception is thrown.

The new \doxylink{class_qore_1_1_socket}{Socket} object returned will have the same character encoding as the current object. Once a new connection has been accepted, call \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} to get information about the remote socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Socket\ new\_socket\ =\ sock.acceptSSL();\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
When a new connection is accepted and a TLS/\+SSL session has been successfully negotiated, a new \doxylink{class_qore_1_1_socket}{Socket} object is returned for the new connectio
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not bound \\
\hline
{\em SOCKET-\/\+ACCEPT-\/\+ERROR} & Error in accepting connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{Socket\+::accept()}, \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}, \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a6955fcbdc09f8e24636ae0f6103e2eb7}\label{class_qore_1_1_socket_a6955fcbdc09f8e24636ae0f6103e2eb7} 
\index{Qore::Socket@{Qore::Socket}!acceptSSL@{acceptSSL}}
\index{acceptSSL@{acceptSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{acceptSSL()}{acceptSSL()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} Qore\+::\+Socket\+::accept\+SSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms }\end{DoxyParamCaption})}



Accepts connections on a listening socket and attempts to negotiate a TLS/\+SSL connection accepting a timeout value with a millisecond resolution. 

If any errors occur, an exception is thrown.

The new \doxylink{class_qore_1_1_socket}{Socket} object returned will have the same character encoding as the current object. Once a new connection has been accepted, call \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} to get information about the remote socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*Socket\ new\_socket\ =\ sock.acceptSSL(30s);\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & If a timeout value is passed and the connection takes longer to establish than the timeout, then \doxysectlink{basic_data_types_nothing}{NOTHING}{1} is returned. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
If no connection is accepted within the timeout period, then \doxysectlink{basic_data_types_nothing}{NOTHING}{1} is returned, otherwise a \doxylink{class_qore_1_1_socket}{Socket} object for the new connection is returned.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not bound \\
\hline
{\em SOCKET-\/\+ACCEPT-\/\+ERROR} & Error in accepting connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adb234af8e02eee33b15a55f0ad37f690}{Socket\+::accept\+SSL()}, \doxylink{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}{Socket\+::listen()}, \doxylink{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}{Socket\+::get\+Peer\+Info()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a801a23bb93b9104179c211f6704bc1de}\label{class_qore_1_1_socket_a801a23bb93b9104179c211f6704bc1de} 
\index{Qore::Socket@{Qore::Socket}!bind@{bind}}
\index{bind@{bind}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{bind()}{bind()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::bind (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{port,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}}}]{reuseaddr = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}} }\end{DoxyParamCaption})}



Opens and binds the socket to an INET port on all interfaces. 

If the second parameter is \doxysectlink{basic_data_types_True}{True}{2}, then the socket will set the {\ttfamily SO\+\_\+\+REUSEADDR} option, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state).

If any errors occur a non-\/zero error code is returned.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ port\ 80\ on\ all\ interfaces\ on\ the\ local\ system\ and\ reuse\ the\ address,\ check\ return\ code}}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.bind(80,\ \textcolor{keyword}{True}))}
\DoxyCodeLine{\ \ \ \ throw\ \textcolor{stringliteral}{"{}BIND-\/ERROR"{}},\ strerror();\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em port} & A port number to bind to on all interfaces \\
\hline
{\em reuseaddr} & If this optional argument evaluates to \doxysectlink{basic_data_types_True}{True}{2}, the {\ttfamily SO\+\_\+\+REUSEADDR} option will be set on the socket, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state)\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7}{Socket\+::bind\+INET()} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f}{Socket\+::bind\+UNIX()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}\label{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8} 
\index{Qore::Socket@{Qore::Socket}!bind@{bind}}
\index{bind@{bind}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{bind()}{bind()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::bind (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}}}]{reuseaddr = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}} }\end{DoxyParamCaption})}



Opens and binds the socket to a port, interface and port (if the bind\+\_\+to string has a format "{}host\+:port"{}), or UNIX domain socket file. 

If the second parameter is \doxysectlink{basic_data_types_True}{True}{2}, then the socket will set the {\ttfamily SO\+\_\+\+REUSEADDR} option, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state).

If any errors occur a non-\/zero error code is returned.

This method tries to automatically pick the appropriate address family from the arguments; note that a hostname or address in square brackets (ex\+: {\ttfamily "{}\mbox{[}localhost\mbox{]}"{}}) will be looked up and bound as an IPv6 address; additionally, the method recognizes ipv6 addresses by embedded colons (\+:) in the address string and binds them as such.

Internally, the \doxylink{group__library__functions_ga30a65bf8f992dd435b05f92c3fa734e5}{getaddrinfo()} function is used to look up bind addresses; internal {\ttfamily \doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{bind()}} operations are tried in sequence for each address returned; as soon as a bind operation is successful, the method returns. If none of the addresses can be bound, then an error code is returned.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ a\ UNIX\ socket\ on\ the\ local\ system\ and\ reuse\ the\ address,\ check\ return\ code}}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.bind(\textcolor{stringliteral}{"{}/tmp/my-\/socket"{}},\ \textcolor{keyword}{True}))}
\DoxyCodeLine{\ \ \ \ throw\ \textcolor{stringliteral}{"{}BIND-\/ERROR"{}},\ strerror();\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em str} & If a colon appears in the string, the string will be assumed to be a {\ttfamily "{}bind\+\_\+address\+:port"{}} specification, and the port on the named IP address will be bound, otherwise, if the string contains no colon, the socket will be bound to a UNIX domain socket file on the local filesystem with the given name. Note that a hostname or address in square brackets (ex\+: {\ttfamily "{}\mbox{[}localhost\mbox{]}"{}}) will be looked up and bound as an IPv6 address; additionally, the method recognizes ipv6 addresses by embedded colons (\+:) in the address string (if surrounded by square brackets) and binds them as such. \\
\hline
{\em reuseaddr} & If this optional argument evaluates to \doxysectlink{basic_data_types_True}{True}{2}, the {\ttfamily SO\+\_\+\+REUSEADDR} option will be set on the socket, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state); note that this only applies to IPv4 (\doxylink{group__network__address__family__constants_gad33bf2a0a393d1100099acfb6ca644e2}{AF\+\_\+\+INET}) and IPv6 (\doxylink{group__network__address__family__constants_ga4b71df64cd838d8f5c0c1974d3011dab}{AF\+\_\+\+INET6}) sockets; this option is ignored for UNIX (\doxylink{group__network__address__family__constants_ga6d1177c9edd5e022ab3b9b1fcadfa3f3}{AF\+\_\+\+UNIX}) sockets.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7}{Socket\+::bind\+INET()} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f}{Socket\+::bind\+UNIX()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
UNIX domain sockets are not available on native Windows ports 
\end{DoxyNote}
\Hypertarget{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7}\label{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7} 
\index{Qore::Socket@{Qore::Socket}!bindINET@{bindINET}}
\index{bindINET@{bindINET}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{bindINET()}{bindINET()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::bind\+INET (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{iface,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}}}]{service,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softbool}}}]{reuseaddr = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{family = {\ttfamily \mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Opens and binds the socket to the given IPv4 or IPv6 interface (or if no interface is given, then to all interfaces on the local system) and port (the port number will be derived from the service name if a numeric port number is not given) 

Opens and binds the socket to a port, interface and port (if the interface string has a format {\ttfamily "{}host\+:port"{}}), or UNIX domain socket file (if no port or service name appears in the bind string). If the second parameter is \doxysectlink{basic_data_types_True}{True}{2}, then the socket will set the {\ttfamily SO\+\_\+\+REUSEADDR} option, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state).

Internally, the \doxylink{group__library__functions_ga30a65bf8f992dd435b05f92c3fa734e5}{getaddrinfo()} function is used to look up bind addresses; internal \doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{bind()} operations are tried in sequence for each address returned; as soon as a bind operation is successful, the method returns. If none of the addresses can be bound, then an error code is returned.

If any errors occur, an exception is thrown.

\begin{DoxyParagraph}{Examples\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ port\ 80\ on\ all\ interfaces\ on\ the\ local\ system\ and\ reuse\ the\ address}}
\DoxyCodeLine{sock.bindINET(NOTHING,\ 80,\ \textcolor{keyword}{True});\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ interface\ 192.168.2.23\ port\ 8080\ and\ do\ not\ reuse\ the\ address}}
\DoxyCodeLine{sock.bindINET(\textcolor{stringliteral}{"{}192.168.2.23"{}},\ 8080);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ localhost\ port\ 8080\ with\ ipv6\ and\ do\ not\ reuse\ the\ address}}
\DoxyCodeLine{sock.bindINET(\textcolor{stringliteral}{"{}localhost"{}},\ 8080,\ \textcolor{keyword}{False},\ AF\_INET6);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ ipv6\ host\ address\ fe80::21c:42ff:fe00:8,\ port\ 1001,\ reuse\ the\ address}}
\DoxyCodeLine{sock.bindINET(\textcolor{stringliteral}{"{}fe80::21c:42ff:fe00:8"{}},\ 1001,\ \textcolor{keyword}{True});\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em iface} & the host name or IP address to bind to \\
\hline
{\em service} & the service name (ex\+: "{}http"{} or port number (given as or converted to a string) to bind to \\
\hline
{\em reuseaddr} & if this optional argument evaluates to True, the {\ttfamily SO\+\_\+\+REUSEADDR} option will be set on the socket, which will allow the socket to be bound to a port that is not yet closed (for example, in a {\ttfamily TIME\+\_\+\+WAIT} state) \\
\hline
{\em family} & the address family to use to bind; see Network Address Family Constants; {\ttfamily AF\+\_\+\+UNSPEC} means to try all possible addres families \\
\hline
{\em socktype} & the type of socket; see \doxylink{group__socket__type__constants}{Socket Type Constants}; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & the protocol number for the socket; use 0 for the default protocol\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+BIND-\/\+ERROR} & Both hostname and service name are empty or not set; error opening socket for bind; error binding on socket. \\
\hline
{\em QOREADDRINFO-\/\+GETINFO-\/\+ERROR} & error looking up either nodename or servicename (or not known)\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{Socket\+::bind()} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f}{Socket\+::bind\+UNIX()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f}\label{class_qore_1_1_socket_aea01252ce4c831d5d26c28617249e14f} 
\index{Qore::Socket@{Qore::Socket}!bindUNIX@{bindUNIX}}
\index{bindUNIX@{bindUNIX}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{bindUNIX()}{bindUNIX()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::bind\+UNIX (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Opens and binds the socket to the given UNIX domain socket file as given by the filename argument. If any errors occur, an exception is thrown. 

Opens and binds the socket to the given UNIX domain socket file as given by the filename argument. Note that the socket file is automatically deleted in the destructor when a UNIX socket is closed. If any errors occur, an exception is thrown.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ bind\ to\ UNIX\ domain\ socket\ file\ "{}/tmp/socket"{}}}
\DoxyCodeLine{sock.bindUNIX(\textcolor{stringliteral}{"{}/tmp/socket"{}});\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & The path of the UNIX domain socket to create and bind to \\
\hline
{\em socktype} & the type of socket; see \doxylink{class_qore_1_1_socket}{Socket} \doxylink{namespace_qore_1_1_type}{Type} Constants; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & the protocol number for the socket; use 0 for the default protocol\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+BIND-\/\+ERROR} & Error opening socket for bind; error binding on socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{Socket\+::bind()} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a884a0c357060e9f2011e08512d7d16d7}{Socket\+::bind\+INET()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
UNIX domain sockets are not available on native Windows ports 
\end{DoxyNote}
\Hypertarget{class_qore_1_1_socket_a1f13f8ff6573368f167cb65480302c5a}\label{class_qore_1_1_socket_a1f13f8ff6573368f167cb65480302c5a} 
\index{Qore::Socket@{Qore::Socket}!captureRemoteCertificates@{captureRemoteCertificates}}
\index{captureRemoteCertificates@{captureRemoteCertificates}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{captureRemoteCertificates()}{captureRemoteCertificates()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::capture\+Remote\+Certificates (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{set = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Sets the flag for capturing remote X.\+509 certificates; by default no capture of remote certificates is performed. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.captureRemoteCertificates();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em set} & the flag for capturing remote X.\+509 certificates; by default no capture of remote certificates is performed\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the old value of the flag
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a71487cf967828b884ba41ad30ff4bda1}{get\+Remote\+Certificate()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9.\+3 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aa11d890255025ccbbf02ff26724b282c}\label{class_qore_1_1_socket_aa11d890255025ccbbf02ff26724b282c} 
\index{Qore::Socket@{Qore::Socket}!clearStats@{clearStats}}
\index{clearStats@{clearStats}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{clearStats()}{clearStats()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::clear\+Stats (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears performance statistics. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.clearStats();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+9
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a528fa7341e599d9f14aa6bbe96356e3c}{Socket\+::get\+Usage\+Info()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a9879dc24c43dbc9784386e36f1c2425b}\label{class_qore_1_1_socket_a9879dc24c43dbc9784386e36f1c2425b} 
\index{Qore::Socket@{Qore::Socket}!clearWarningQueue@{clearWarningQueue}}
\index{clearWarningQueue@{clearWarningQueue}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{clearWarningQueue()}{clearWarningQueue()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::clear\+Warning\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Removes any warning \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object from the \doxylink{class_qore_1_1_socket}{Socket}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.clearWarningQueue();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+9 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a40deec9f0ac1abcfca999b9592bed0ee}\label{class_qore_1_1_socket_a40deec9f0ac1abcfca999b9592bed0ee} 
\index{Qore::Socket@{Qore::Socket}!close@{close}}
\index{close@{close}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{close()}{close()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::close (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Closes an open socket. 

Also deletes the UNIX domain socket file if it was created by a call to \doxylink{class_qore_1_1_socket_a84303b48fef02b3a1e2b29184ac53bc8}{Socket\+::bind()}. Returns 0 for success, -\/1 for error; in this case check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the error number

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.close())}
\DoxyCodeLine{\ \ \ \ stderr.printf(\textcolor{stringliteral}{"{}Error\ closing\ socket:\ \%s\(\backslash\)n"{}},\ strerror(errno()));}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CHANNEL_CLOSED}{EVENT\+\_\+\+CHANNEL\+\_\+\+CLOSED}{1}
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
0 for success, -\/1 for error; in this case check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the error number 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}\label{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b} 
\index{Qore::Socket@{Qore::Socket}!connect@{connect}}
\index{connect@{connect}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connect()}{connect()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{target,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Connects to a remote port (if the string has a format "{}host\+:port"{}) or UNIX domain socket file. 

Connects the socket to a remote (or local) port or UNIX domain socket file, for network (ipv4 and ipv6) connections, accepts an optional timeout value in milliseconds (\doxysectlink{basic_data_types_relative_dates}{relative date/time values}{2} can be given instead of an integer in milliseconds to make the source more readable; ex\+: {\ttfamily 20s}). If any errors occur, an exception is thrown.

\begin{DoxyParagraph}{Examples\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv4\ adress\ 192.168.1.45\ port\ 8080\ with\ a\ 30\ second\ timeout}}
\DoxyCodeLine{sock.connect(\textcolor{stringliteral}{"{}192.168.1.45:8080"{}},\ 30s);}

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv6\ adress\ 2001:0db8:85a3:0000:0000:8a2e:0370:7334\ port\ 80\ with\ a\ 10\ second\ timeout}}
\DoxyCodeLine{sock.connect(\textcolor{stringliteral}{"{}[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80"{}},\ 10s);}

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ localhost\ using\ ipv6\ (::1)\ port\ 80\ with\ a\ 10\ second\ timeout}}
\DoxyCodeLine{sock.connect(\textcolor{stringliteral}{"{}[localhost]:80"{}},\ 15s);}

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ UNIX\ domain\ socket\ file\ "{}/tmp/socket"{}}}
\DoxyCodeLine{sock.connect(\textcolor{stringliteral}{"{}/tmp/socket"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_LOOKUP}{EVENT\+\_\+\+HOSTNAME\+\_\+\+LOOKUP}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_RESOLVED}{EVENT\+\_\+\+HOSTNAME\+\_\+\+RESOLVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em target} & The target address interpreted with the following rules\+:
\begin{DoxyItemize}
\item If a colon appears in the string, the string will be assumed to be a {\ttfamily "{}hostname\+:port"{}} specification to connect to; where {\ttfamily "{}port"{}} can also be a service name (ex\+: {\ttfamily "{}example.\+com\+:https"{}})
\item If the string contains no colon, the socket will try to connect to a UNIX domain socket file on the local filesystem with the given name.
\item Enclose ipv6 addresses in square brackets (ex\+: {\ttfamily "{}\mbox{[}2001\+:0db8\+:85a3\+:0000\+:0000\+:8a2e\+:0370\+:7334\mbox{]}\+:80"{}}, will connect to port 80 on the given ipv6 address); also if a hostname is enclosed in square brackets, it will be resolved as an IPv6 address (ex\+: {\ttfamily "{}\mbox{[}localhost\mbox{]}\+:80"{}} will connect to port {\ttfamily 80} on {\ttfamily \+::1}, assuming {\ttfamily "{}localhost"{}} can be resolved to the IPv6 loopback address on the system). 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & If a timeout value is passed and the connection takes longer to establish than the timeout, a {\ttfamily "{}\+SOCKET-\/\+CONNECT-\/\+ERROR"{}} exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the remote socket (cannot resolve hostname, no listener, timeout exceeded, etc).\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()}, \doxylink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{Socket\+::connect\+INETSSL()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{Socket\+::connect\+UNIXSSL()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}\label{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525} 
\index{Qore::Socket@{Qore::Socket}!connectINET@{connectINET}}
\index{connectINET@{connectINET}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connectINET()}{connectINET()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect\+INET (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{host,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}}}]{service,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{family = {\ttfamily \mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Connects to the given host and port with an optional timeout value with a millisecond resolution. 

Connects the socket to a remote (or local) port; accepts an optional timeout value in milliseconds (\doxysectlink{basic_data_types_relative_dates}{relative date/time values}{2} can be given instead of an integer in milliseconds to make the source more readable; ex\+: {\ttfamily 20s}). If any errors occur, an exception is thrown.

Do not use square brackets to designate ipv6 addresses with this method; just give the address in its normal form (ex\+: {\ttfamily "{}2001\+:0db8\+:85a3\+:0000\+:0000\+:8a2e\+:0370\+:7334"{}}).

\begin{DoxyParagraph}{Examples\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv4\ address\ 192.168.1.45\ port\ 8080\ with\ a\ 30\ second\ timeout}}
\DoxyCodeLine{sock.connectINET(\textcolor{stringliteral}{"{}192.168.1.45"{}},\ 8080,\ 30s);}

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv6\ address\ 2001:0db8:85a3:0000:0000:8a2e:0370:7334\ port\ 80\ with\ a\ 20\ second\ timeout}}
\DoxyCodeLine{sock.connectINET(\textcolor{stringliteral}{"{}2001:0db8:85a3:0000:0000:8a2e:0370:7334"{}},\ 80,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_LOOKUP}{EVENT\+\_\+\+HOSTNAME\+\_\+\+LOOKUP}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_RESOLVED}{EVENT\+\_\+\+HOSTNAME\+\_\+\+RESOLVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em host} & The host name or IP address to connect to \\
\hline
{\em service} & The service name (ex\+: {\ttfamily "{}http"{}} or port number (given as or converted to a string) to connect to \\
\hline
{\em timeout\+\_\+ms} & If a timeout value is passed and the connection takes longer to establish than the timeout, a {\ttfamily "{}\+SOCKET-\/\+CONNECT-\/\+ERROR"{}} exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.) \\
\hline
{\em family} & The address family to use to connect to the remote socket; see \doxylink{group__network__address__family__constants}{Network Address Family Constants} \\
\hline
{\em socktype} & The type of socket; see \doxylink{group__socket__type__constants}{Socket Type Constants}; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & The protocol number for the socket (if not sure leave this 0)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the remote socket (cannot resolve hostname, no listener, timeout exceeded, etc)\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}, \doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()}, \doxylink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{Socket\+::connect\+INETSSL()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{Socket\+::connect\+UNIXSSL()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}\label{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e} 
\index{Qore::Socket@{Qore::Socket}!connectINETSSL@{connectINETSSL}}
\index{connectINETSSL@{connectINETSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connectINETSSL()}{connectINETSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect\+INETSSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{host,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softstring}}}]{service,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{family = {\ttfamily \mbox{\hyperlink{group__network__address__family__constants_gac4f81abe9d374562b41117c51950fb80}{AF\+\_\+\+UNSPEC}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Connects to the given host and port and attempts to establish a TLS/\+SSL connection; accepts an optional timeout value with a millisecond resolution. 

Connects the socket to a remote (or local) port and attempts to establish a TLS/\+SSL connection; accepts an optional timeout value in milliseconds (\doxysectlink{basic_data_types_relative_dates}{relative date/time values}{2} can be given instead of an integer in milliseconds to make the source more readable; ex\+: {\ttfamily 20s}). If any errors occur, an exception is thrown.

Do not use square brackets to designate ipv6 addresses with this method; just give the address in its normal form (ex\+: {\ttfamily "{}2001\+:0db8\+:85a3\+:0000\+:0000\+:8a2e\+:0370\+:7334"{}}).

\begin{DoxyParagraph}{Examples\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ 192.168.1.45\ port\ 8080\ with\ a\ 30\ second\ timeout}}
\DoxyCodeLine{sock.connectINETSSL(\textcolor{stringliteral}{"{}192.168.1.45"{}},\ 8080,\ 30s);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv6\ address\ 2001:0db8:85a3:0000:0000:8a2e:0370:7334\ port\ 80\ with\ a\ 20\ second\ timeout}}
\DoxyCodeLine{sock.connectINETSSL(\textcolor{stringliteral}{"{}2001:0db8:85a3:0000:0000:8a2e:0370:7334"{}},\ 80,\ 20s);\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_LOOKUP}{EVENT\+\_\+\+HOSTNAME\+\_\+\+LOOKUP}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_RESOLVED}{EVENT\+\_\+\+HOSTNAME\+\_\+\+RESOLVED}{1}, \doxysectlink{event_handling_EVENT_START_SSL}{EVENT\+\_\+\+START\+\_\+\+SSL}{1}, \doxysectlink{event_handling_EVENT_SSL_ESTABLISHED}{EVENT\+\_\+\+SSL\+\_\+\+ESTABLISHED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em host} & The host name or IP address to connect to \\
\hline
{\em service} & The service name (ex\+: {\ttfamily "{}http"{}} or port number (given as or converted to a string) to connect to \\
\hline
{\em timeout\+\_\+ms} & If a timeout value is passed and the connection takes longer to establish than the timeout, a {\ttfamily "{}\+SOCKET-\/\+CONNECT-\/\+ERROR"{}} exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.) \\
\hline
{\em family} & The address family to use to connect to the remote socket; see \doxylink{group__network__address__family__constants}{Network Address Family Constants} \\
\hline
{\em socktype} & The type of socket; see \doxylink{group__socket__type__constants}{Socket Type Constants}; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & The protocol number for the socket (if not sure leave this 0)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the remote socket (cannot resolve hostname, no listener, timeout exceeded, etc) \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & An error occurred establishing the TLS/\+SSL connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}, \doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()}, \doxylink{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}{Socket\+::connect\+INET()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{Socket\+::connect\+UNIXSSL()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}\label{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5} 
\index{Qore::Socket@{Qore::Socket}!connectSSL@{connectSSL}}
\index{connectSSL@{connectSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connectSSL()}{connectSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect\+SSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{target,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Connects to a remote socket and attempts to establish a TLS/\+SSL connection; accepts an optional timeout value with a millisecond resolution. 

Connects to a remote socket and attempts to establish a TLS/\+SSL connection, for network (INET) connections, accepts an optional timeout value in milliseconds (\doxysectlink{basic_data_types_relative_dates}{relative date/time values}{2} can be given instead of an integer in milliseconds to make the source more readable; ex\+: {\ttfamily 20s}). If any errors occur, an exception is thrown.

Enclose ipv6 addresses in square brackets (ex\+: {\ttfamily "{}\mbox{[}2001\+:0db8\+:85a3\+:0000\+:0000\+:8a2e\+:0370\+:7334\mbox{]}\+:80"{}}, will connect to port 80 on the given ipv6 address); also if a hostname is enclosed in square brackets, it will be resolved as an ipv6 adress (ex\+: {\ttfamily "{}\mbox{[}localhost\mbox{]}\+:80"{}} will connect to port {\ttfamily 80} on {\ttfamily \+::1}, assuming {\ttfamily "{}localhost"{}} can be resolved to the ipv6 loopback address on the system).

\begin{DoxyParagraph}{Examples\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv4\ adress\ 192.168.1.45\ port\ 8080\ with\ a\ 30\ second\ timeout}}
\DoxyCodeLine{sock.connectSSL(\textcolor{stringliteral}{"{}192.168.1.45:8080"{}},\ 30s);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ ipv6\ adress\ 2001:0db8:85a3:0000:0000:8a2e:0370:7334\ port\ 80\ with\ a\ 10\ second\ timeout}}
\DoxyCodeLine{sock.connectSSL(\textcolor{stringliteral}{"{}[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80"{}},\ 10s);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ localhost\ using\ ipv6\ (::1)\ port\ 80\ with\ a\ 10\ second\ timeout}}
\DoxyCodeLine{sock.connectSSL(\textcolor{stringliteral}{"{}[localhost]:80"{}},\ 15s);\ }

\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ UNIX\ domain\ socket\ file\ "{}/tmp/socket"{}}}
\DoxyCodeLine{sock.connectSSL(\textcolor{stringliteral}{"{}/tmp/socket"{}});\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_LOOKUP}{EVENT\+\_\+\+HOSTNAME\+\_\+\+LOOKUP}{1}, \doxysectlink{event_handling_EVENT_HOSTNAME_RESOLVED}{EVENT\+\_\+\+HOSTNAME\+\_\+\+RESOLVED}{1}, \doxysectlink{event_handling_EVENT_START_SSL}{EVENT\+\_\+\+START\+\_\+\+SSL}{1}, \doxysectlink{event_handling_EVENT_SSL_ESTABLISHED}{EVENT\+\_\+\+SSL\+\_\+\+ESTABLISHED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em target} & The target address interpreted with the following rules\+:
\begin{DoxyItemize}
\item If a colon appears in the string, the string will be assumed to be a {\ttfamily "{}hostname\+:port"{}} specification to connect to; where {\ttfamily "{}port"{}} can also be a service name (ex\+: {\ttfamily "{}example.\+com\+:https"{}})
\item If the string contains no colon, the socket will try to connect to a UNIX domain socket file on the local filesystem with the given name.
\item Enclose ipv6 addresses in square brackets (ex\+: {\ttfamily "{}\mbox{[}2001\+:0db8\+:85a3\+:0000\+:0000\+:8a2e\+:0370\+:7334\mbox{]}\+:80"{}}, will connect to port 80 on the given ipv6 address); also if a hostname is enclosed in square brackets, it will be resolved as an ipv6 address (ex\+: {\ttfamily "{}\mbox{[}localhost\mbox{]}\+:80"{}} will connect to port {\ttfamily 80} on {\ttfamily \+::1}, assuming {\ttfamily "{}localhost"{}} can be resolved to the ipv6 loopback address on the system). 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & if a timeout value is passed and the connection takes longer to establish than the timeout, an exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the remote socket (cannot resolve hostname, no listener, timeout exceeded, etc) \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & An error occurred establishing the TLS/\+SSL connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}, \doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{Socket\+::connect\+UNIXSSL()}, \doxylink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{Socket\+::connect\+INETSSL()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}{Socket\+::connect\+INET()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}\label{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160} 
\index{Qore::Socket@{Qore::Socket}!connectUNIX@{connectUNIX}}
\index{connectUNIX@{connectUNIX}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connectUNIX()}{connectUNIX()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect\+UNIX (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Connects to a UNIX domain socket file. 

Connects the socket to the given UNIX domain socket file; if any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ UNIX\ domain\ socket\ file\ "{}/tmp/socket"{}}}
\DoxyCodeLine{sock.connectUNIX(\textcolor{stringliteral}{"{}/tmp/socket"{}});\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & The socket will try to connect to a UNIX domain socket file on the local filesystem with the given name \\
\hline
{\em socktype} & The type of socket; see \doxylink{group__socket__type__constants}{Socket Type Constants}; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & The protocol number for the socket (if not sure leave this 0)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}, \doxylink{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}{Socket\+::connect\+INET()}, \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()}, \doxylink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{Socket\+::connect\+INETSSL()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}{Socket\+::connect\+UNIXSSL()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
UNIX domain sockets are not available on native Windows ports 
\end{DoxyNote}
\Hypertarget{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5}\label{class_qore_1_1_socket_a59cf5a059d8116b8c90a81aa423f7af5} 
\index{Qore::Socket@{Qore::Socket}!connectUNIXSSL@{connectUNIXSSL}}
\index{connectUNIXSSL@{connectUNIXSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{connectUNIXSSL()}{connectUNIXSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::connect\+UNIXSSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{socktype = {\ttfamily \mbox{\hyperlink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM}}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{protocol = {\ttfamily 0} }\end{DoxyParamCaption})}



Connects to the given UNIX domain socket file and attempts to establish a TLS/\+SSL connection. 

Connects the socket to a UNIX domain socket file and attempts to establish a TLS/\+SSL connection. If any errors occur, an exception is thrown.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\ \textcolor{comment}{\#\ connect\ to\ UNIX\ domain\ socket\ file\ "{}/tmp/socket"{}}}
\DoxyCodeLine{sock.connectUNIXSSL(\textcolor{stringliteral}{"{}/tmp/socket"{}});\ }

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_CONNECTING}{EVENT\+\_\+\+CONNECTING}{1}, \doxysectlink{event_handling_EVENT_CONNECTED}{EVENT\+\_\+\+CONNECTED}{1}, \doxysectlink{event_handling_EVENT_START_SSL}{EVENT\+\_\+\+START\+\_\+\+SSL}{1}, \doxysectlink{event_handling_EVENT_SSL_ESTABLISHED}{EVENT\+\_\+\+SSL\+\_\+\+ESTABLISHED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & The socket will try to connect to a UNIX domain socket file on the local filesystem with the given name \\
\hline
{\em socktype} & The type of socket; see \doxylink{group__socket__type__constants}{Socket Type Constants}; typically \doxylink{group__socket__type__constants_ga658ebfaeb8e533f106b3019ba3007531}{SOCK\+\_\+\+STREAM} for TCP sockets \\
\hline
{\em protocol} & The protocol number for the socket (if not sure leave this 0)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+CONNECT-\/\+ERROR} & An error occured connecting to the socket \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & An error occurred establishing the TLS/\+SSL connection\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}, \doxylink{class_qore_1_1_socket_ad78760d607de20703f921f6dc1db5160}{Socket\+::connect\+UNIX()}, \doxylink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+SSL()}, \doxylink{class_qore_1_1_socket_a6f7b45a71eff6bc252cb740491012c2e}{Socket\+::connect\+INETSSL()}, \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{and} \doxylink{class_qore_1_1_socket_a7b18f9cd3c198300606d4699a5f9a525}{Socket\+::connect\+INET()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
UNIX domain sockets are not available on native Windows ports 
\end{DoxyNote}
\Hypertarget{class_qore_1_1_socket_aae2f017c8bf867f2380c2dbc873af465}\label{class_qore_1_1_socket_aae2f017c8bf867f2380c2dbc873af465} 
\index{Qore::Socket@{Qore::Socket}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates the socket object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Socket\ sock();\ }

\end{DoxyCode}
 
\end{DoxyParagraph}
\Hypertarget{class_qore_1_1_socket_aa91f15de558a8ca27680cef49bb508ad}\label{class_qore_1_1_socket_aa91f15de558a8ca27680cef49bb508ad} 
\index{Qore::Socket@{Qore::Socket}!copy@{copy}}
\index{copy@{copy}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates a new \doxylink{class_qore_1_1_socket}{Socket} object, not based on the source being copied. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Socket\ newsock\ =\ sock.copy();\ }

\end{DoxyCode}
 
\end{DoxyParagraph}
\Hypertarget{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9}\label{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9} 
\index{Qore::Socket@{Qore::Socket}!getAcceptAllCertificates@{getAcceptAllCertificates}}
\index{getAcceptAllCertificates@{getAcceptAllCertificates}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getAcceptAllCertificates()}{getAcceptAllCertificates()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::get\+Accept\+All\+Certificates (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the current value of the "{}accept all certificates"{} flag 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.getAcceptAllCertificates();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the current value of the "{}accept all certificates"{} flag; if \doxysectlink{basic_data_types_True}{True}{2}, then self-\/signed certificates are accepted, if \doxysectlink{basic_data_types_False}{False}{2}, then they are not
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db}{Socket\+::accept\+All\+Certificates()}
\item \doxylink{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac}{Socket\+::set\+Ssl\+Verify\+Mode()}
\item \doxylink{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5}{Socket\+::get\+Ssl\+Verify\+Mode()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_afbf2522548202dfc71cea1584bcda764}\label{class_qore_1_1_socket_afbf2522548202dfc71cea1584bcda764} 
\index{Qore::Socket@{Qore::Socket}!getCharset@{getCharset}}
\index{getCharset@{getCharset}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getCharset()}{getCharset()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::get\+Charset (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the \doxylink{character_encoding}{character encoding} for the socket. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
A method synonym for \doxylink{class_qore_1_1_socket_acd67aa33bbd8eefa5b557ae16a7bdecf}{Socket\+::get\+Encoding()}, kept for backwards-\/compatibility \begin{DoxyReturn}{Returns}
the \doxylink{character_encoding}{character encoding} for the socket 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a6f38a1974f2b791805d9a1793c073adf}\label{class_qore_1_1_socket_a6f38a1974f2b791805d9a1793c073adf} 
\index{Qore::Socket@{Qore::Socket}!getConnectionId@{getConnectionId}}
\index{getConnectionId@{getConnectionId}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getConnectionId()}{getConnectionId()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Connection\+Id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an integer connection ID that is incremented every time the socket is disconnected. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ conn\_id\ =\ sock.getConnectionId();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
an integer connection ID that is incremented every time the socket is disconnected
\end{DoxyReturn}
This number can be used to identify new connections

\begin{DoxySince}{Since}
Qore 0.\+9.\+3.\+1 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_acd67aa33bbd8eefa5b557ae16a7bdecf}\label{class_qore_1_1_socket_acd67aa33bbd8eefa5b557ae16a7bdecf} 
\index{Qore::Socket@{Qore::Socket}!getEncoding@{getEncoding}}
\index{getEncoding@{getEncoding}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getEncoding()}{getEncoding()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::get\+Encoding (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the \doxylink{character_encoding}{character encoding} for the socket. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the \doxylink{character_encoding}{character encoding} for the socket 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a3cbc1223bd9cba7d58052febd5e92dab}\label{class_qore_1_1_socket_a3cbc1223bd9cba7d58052febd5e92dab} 
\index{Qore::Socket@{Qore::Socket}!getNoDelay@{getNoDelay}}
\index{getNoDelay@{getNoDelay}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getNoDelay()}{getNoDelay()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::get\+No\+Delay (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.getNoDelay();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ada4d53ed63a5df3ec798153a3caf65d1}{Socket\+::set\+No\+Delay()} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{for} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{a} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{description} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{of} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{the} {\ttfamily \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{TCP\+\_\+\+NODELAY}} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{setting} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9}\label{class_qore_1_1_socket_a73258d38a743887ffa969407cc1ccec9} 
\index{Qore::Socket@{Qore::Socket}!getPeerInfo@{getPeerInfo}}
\index{getPeerInfo@{getPeerInfo}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getPeerInfo()}{getPeerInfo()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::get\+Peer\+Info (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{host\+\_\+lookup = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Returns a \doxylink{class_qore_1_1_socket_socket_info_hash}{hash of information} about the remote end for connected sockets. 

If the socket is not connected, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ h\ =\ sock.getPeerInfo();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em host\+\_\+lookup} & do a lookup of the hostname; if this is \doxysectlink{basic_data_types_False}{False}{2} then {\ttfamily "{}hostname"{}} and {\ttfamily "{}hostname\+\_\+desc"{}} are not present in the response hash\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a \doxylink{class_qore_1_1_socket_socket_info_hash}{hash of information} about the remote end for connected sockets
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not open \\
\hline
{\em SOCKET-\/\+GETPEERINFO-\/\+ERROR} & error in \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{getpeername()}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 added the {\itshape host\+\_\+lookup} parameter 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ae5077a1a1be1ce30a5251be59d760751}\label{class_qore_1_1_socket_ae5077a1a1be1ce30a5251be59d760751} 
\index{Qore::Socket@{Qore::Socket}!getPort@{getPort}}
\index{getPort@{getPort}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getPort()}{getPort()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Port (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the port number of the socket for INET sockets. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ port\ =\ sock.getPort();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the port number for an INET connection, -\/1 if no INET connection has been established 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a9d6ede847e9d88b25eb3fea209fcbe3a}\label{class_qore_1_1_socket_a9d6ede847e9d88b25eb3fea209fcbe3a} 
\index{Qore::Socket@{Qore::Socket}!getRecvTimeout@{getRecvTimeout}}
\index{getRecvTimeout@{getRecvTimeout}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getRecvTimeout()}{getRecvTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Recv\+Timeout (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the receive timeout socket option value as an integer in milliseconds. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ to\ =\ sock.getRecvTimeout();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the receive timeout socket option value as an integer in milliseconds 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a71487cf967828b884ba41ad30ff4bda1}\label{class_qore_1_1_socket_a71487cf967828b884ba41ad30ff4bda1} 
\index{Qore::Socket@{Qore::Socket}!getRemoteCertificate@{getRemoteCertificate}}
\index{getRemoteCertificate@{getRemoteCertificate}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getRemoteCertificate()}{getRemoteCertificate()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}} Qore\+::\+Socket\+::get\+Remote\+Certificate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns any remote certificate captured or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if there is none. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*SSLCertificate\ cert\ =\ sock.getRemoteCertificate();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
any remote certificate captured or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if there is none
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a1f13f8ff6573368f167cb65480302c5a}{capture\+Remote\+Certificates()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9.\+3 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a037f1e937dba99b785dc846799f479b6}\label{class_qore_1_1_socket_a037f1e937dba99b785dc846799f479b6} 
\index{Qore::Socket@{Qore::Socket}!getSendTimeout@{getSendTimeout}}
\index{getSendTimeout@{getSendTimeout}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSendTimeout()}{getSendTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Send\+Timeout (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the send timeout socket option value as an integer in milliseconds. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ to\ =\ sock.getSendTimeout();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the send timeout socket option value as an integer in milliseconds 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a287387be61ed857ad44f9fa79ad4292c}\label{class_qore_1_1_socket_a287387be61ed857ad44f9fa79ad4292c} 
\index{Qore::Socket@{Qore::Socket}!getSocket@{getSocket}}
\index{getSocket@{getSocket}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSocket()}{getSocket()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Socket (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the socket file descriptor number. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ sock\ =\ sock.getSocket();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the socket file descriptor number or -\/1 if the socket is not open 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a2b2e555609f4a7c98813f91d6109fb90}\label{class_qore_1_1_socket_a2b2e555609f4a7c98813f91d6109fb90} 
\index{Qore::Socket@{Qore::Socket}!getSocketInfo@{getSocketInfo}}
\index{getSocketInfo@{getSocketInfo}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSocketInfo()}{getSocketInfo()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::get\+Socket\+Info (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{host\+\_\+lookup = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Returns information about the local socket as a hash. 

If the socket is not open, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ h\ =\ sock.getSocketInfo();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em host\+\_\+lookup} & do a lookup of the hostname; if this is \doxysectlink{basic_data_types_False}{False}{2} then {\ttfamily "{}hostname"{}} and {\ttfamily "{}hostname\+\_\+desc"{}} are not present in the response hash\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a \doxylink{class_qore_1_1_socket_socket_info_hash}{hash of information} about the remote end for connected sockets
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not open \\
\hline
{\em SOCKET-\/\+GETSOCKETINFO-\/\+ERROR} & error in \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{getsockname()}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 added the {\itshape host\+\_\+lookup} parameter 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a416283c6332e611607ee2aa4b2a9cad4}\label{class_qore_1_1_socket_a416283c6332e611607ee2aa4b2a9cad4} 
\index{Qore::Socket@{Qore::Socket}!getSSLCipherName@{getSSLCipherName}}
\index{getSSLCipherName@{getSSLCipherName}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSSLCipherName()}{getSSLCipherName()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::get\+SSLCipher\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the name of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string\ str\ =\ sock.getSSLCipherName();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the name of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a47aae073c822eb9ac197b9befde75a9d}\label{class_qore_1_1_socket_a47aae073c822eb9ac197b9befde75a9d} 
\index{Qore::Socket@{Qore::Socket}!getSSLCipherVersion@{getSSLCipherVersion}}
\index{getSSLCipherVersion@{getSSLCipherVersion}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSSLCipherVersion()}{getSSLCipherVersion()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::get\+SSLCipher\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the version string of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string\ str\ =\ sock.getSSLCipherVersion();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the version string of the cipher for an encrypted connection or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if a secure connection has not been established 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5}\label{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5} 
\index{Qore::Socket@{Qore::Socket}!getSslVerifyMode@{getSslVerifyMode}}
\index{getSslVerifyMode@{getSslVerifyMode}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getSslVerifyMode()}{getSslVerifyMode()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::get\+Ssl\+Verify\+Mode (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the current SSL verification mode 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ mode\ =\ sock.getSslVerifyMode();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the SSL verfication mode, see \doxylink{group__ssl__mode__constants}{SSL Verification Mode Constants} for more information
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9}{Socket\+::get\+Accept\+All\+Certificates()}
\item \doxylink{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac}{Socket\+::set\+Ssl\+Verify\+Mode()}
\item \doxylink{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db}{Socket\+::accept\+All\+Certificates()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a528fa7341e599d9f14aa6bbe96356e3c}\label{class_qore_1_1_socket_a528fa7341e599d9f14aa6bbe96356e3c} 
\index{Qore::Socket@{Qore::Socket}!getUsageInfo@{getUsageInfo}}
\index{getUsageInfo@{getUsageInfo}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{getUsageInfo()}{getUsageInfo()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::get\+Usage\+Info (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns performance statistics for the socket. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ h\ =\ sock.getUsageInfo();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}bytes\+\_\+sent"{}}\+: an integer giving the total amount of bytes sent
\item {\ttfamily "{}bytes\+\_\+recv"{}}\+: an integer giving the total amount of bytes received
\item {\ttfamily "{}us\+\_\+sent"{}}\+: an integer giving the total number of microseconds spent sending data
\item {\ttfamily "{}us\+\_\+recv"{}}\+: an integer giving the total number of microseconds spent receiving data
\item {\ttfamily "{}arg"{}}\+: (only if warning values have been set with \doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()}) the optional argument for warning hashes
\item {\ttfamily "{}timeout"{}}\+: (only if warning values have been set with \doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()}) the warning timeout in microseconds
\item {\ttfamily "{}min\+\_\+throughput"{}}\+: (only if warning values have been set with \doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()}) the minimum warning throughput in bytes/sec
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 0.\+8.\+9
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_aa11d890255025ccbbf02ff26724b282c}{Socket\+::clear\+Stats()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_ada15658191958a262a3c8ca44160f112}\label{class_qore_1_1_socket_ada15658191958a262a3c8ca44160f112} 
\index{Qore::Socket@{Qore::Socket}!isDataAvailable@{isDataAvailable}}
\index{isDataAvailable@{isDataAvailable}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{isDataAvailable()}{isDataAvailable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::is\+Data\+Available (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily 0} }\end{DoxyParamCaption})}



Returns \doxysectlink{basic_data_types_True}{True}{2} or \doxysectlink{basic_data_types_False}{False}{2} depending on whether there is data to be read on the socket. 

With a timeout of zero this method returns immediately and can be used for non-\/blocking polling the socket for data (can also be used to poll for new connections before \doxylink{class_qore_1_1_socket_a39eb3993cde9b9e0096412d1edbc3a57}{Socket\+::accept()}).

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.isDataAvailable();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & an optional timeout in milliseconds (1/1000 second); if no timeout is given, the method returns immediately; Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if data is available on the \doxylink{class_qore_1_1_socket}{Socket} within the timeout period, \doxysectlink{basic_data_types_False}{False}{2} if not
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a1f6e97d05075accded9da7a8ee44defd}\label{class_qore_1_1_socket_a1f6e97d05075accded9da7a8ee44defd} 
\index{Qore::Socket@{Qore::Socket}!isOpen@{isOpen}}
\index{isOpen@{isOpen}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{isOpen()}{isOpen()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::is\+Open (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \doxysectlink{basic_data_types_True}{True}{2} if the socket is open. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.isOpen();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if the socket is open, \doxysectlink{basic_data_types_False}{False}{2} if not 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a62f88e568207417db77890f565063822}\label{class_qore_1_1_socket_a62f88e568207417db77890f565063822} 
\index{Qore::Socket@{Qore::Socket}!isSecure@{isSecure}}
\index{isSecure@{isSecure}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{isSecure()}{isSecure()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::is\+Secure (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \doxysectlink{basic_data_types_True}{True}{2} if the connection is a secure TLS/\+SSL connection. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.isSecure();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if the connection is encrypted, \doxysectlink{basic_data_types_False}{False}{2} if not 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a57f1ae016aa33f5ba449a99a8f7f6cc0}\label{class_qore_1_1_socket_a57f1ae016aa33f5ba449a99a8f7f6cc0} 
\index{Qore::Socket@{Qore::Socket}!isWriteFinished@{isWriteFinished}}
\index{isWriteFinished@{isWriteFinished}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{isWriteFinished()}{isWriteFinished()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::is\+Write\+Finished (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily 0} }\end{DoxyParamCaption})}



Returns \doxysectlink{basic_data_types_True}{True}{2} or \doxysectlink{basic_data_types_False}{False}{2} depending on whether all the data has been written to the socket. 

With a timeout of zero this method returns immediately.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.isWriteFinished();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & an optional timeout in milliseconds (1/1000 second); if no timeout is given, the method returns immediately; Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if the send action completes within the timeout period, \doxysectlink{basic_data_types_False}{False}{2} if not
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159}\label{class_qore_1_1_socket_a430d67ff882a9733d02ff1fa745ca159} 
\index{Qore::Socket@{Qore::Socket}!listen@{listen}}
\index{listen@{listen}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{listen()}{listen()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::listen (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{backlog = {\ttfamily 20} }\end{DoxyParamCaption})}



Listens for connections on a bound socket; sets the socket in a listening state. 

Listens for new connections on a bound socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.listen();\ }

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em backlog} & the size of the queue for pending connections\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns 0 for success, -\/1 for error
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not bound\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 the {\itshape backlog} parameter was added 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a633193d68c0342b2311dac2e5ee6ddfb}\label{class_qore_1_1_socket_a633193d68c0342b2311dac2e5ee6ddfb} 
\index{Qore::Socket@{Qore::Socket}!parseServerSentEvent@{parseServerSentEvent}}
\index{parseServerSentEvent@{parseServerSentEvent}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{parseServerSentEvent()}{parseServerSentEvent()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{static}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ Qore\+::\+Socket\+::parse\+Server\+Sent\+Event (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Parse the given string as a Server Sent Event (SSE) string. 


\begin{DoxyParams}{Parameters}
{\em str} & the string to parse as a Server Sent Event (SSE) string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of the event information 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_a16039558967b42619176a9609bce5399}\label{class_qore_1_1_socket_a16039558967b42619176a9609bce5399} 
\index{Qore::Socket@{Qore::Socket}!pendingHttpChunkedBody@{pendingHttpChunkedBody}}
\index{pendingHttpChunkedBody@{pendingHttpChunkedBody}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{pendingHttpChunkedBody()}{pendingHttpChunkedBody()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::\+Socket\+::pending\+Http\+Chunked\+Body (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns True if the socket is still connected, and a HTTP header was read indicating chunked transfer encoding, but no chunked body has been read yet 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool\ b\ =\ sock.pendingHttpChunkedBody();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+10 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a44c1f81d7797e383a37d1cbd788329e8}\label{class_qore_1_1_socket_a44c1f81d7797e383a37d1cbd788329e8} 
\index{Qore::Socket@{Qore::Socket}!poll@{poll}}
\index{poll@{poll}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{poll()}{poll()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{static}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_socket_poll_info}{Socket\+Poll\+Info}} $>$ $>$ Qore\+::\+Socket\+::poll (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_socket_poll_info}{Socket\+Poll\+Info}} $>$ $>$}]{items,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



polls multiple sockets and returns all sockets with events 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{list<hash<SocketPollInfo>>\ l(}
\DoxyCodeLine{\ \ \ \ <SocketPollInfo>\{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}events"{}}:\ SOCK\_POLLOUT,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}socket"{}}:\ sock1,}
\DoxyCodeLine{\ \ \ \ \},}
\DoxyCodeLine{\ \ \ \ <SocketPollInfo>\{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}events"{}}:\ SOCK\_POLLIN\ |\ SOCK\_POLLOUT,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}socket"{}}:\ sock2,}
\DoxyCodeLine{\ \ \ \ \},}
\DoxyCodeLine{);}
\DoxyCodeLine{l\ =\ Socket::poll(l,\ 2s);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em items} & list of \doxylink{struct_qore_1_1_socket_poll_info}{Socket\+Poll\+Info} hashes of sockets with events in the timeout period \\
\hline
{\em timeout\+\_\+ms} & the poll timeout period; -\/1 = never timeout\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of sockets with events in the timeout period
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+POLL-\/\+ERROR} & {\itshape socket} value in the {\itshape items} argument is not assigned or there was an error in the poll operation \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & {\itshape socket} value in the {\itshape items} argument is closed\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
If a socket being polled is closed or deleted in a background thread, the poll operation is not interrupted on Linux; other platforms behave differently (mac\+OS / Darwin interrupts the polling process in this case); for proper operation on all platforms, do not assume that the polling operation will return immediately if a socket being polled is deleted in a background thread.
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9.\+11 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a440e92d904b546fa1cbd40ce4f36e564}\label{class_qore_1_1_socket_a440e92d904b546fa1cbd40ce4f36e564} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunk@{readHTTPChunk}}
\index{readHTTPChunk@{readHTTPChunk}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunk()}{readHTTPChunk()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::read\+HTTPChunk (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in a single HTTP message chunk. 

If any errors are encountered, an exception is raised. The chunk body is returned as a binary value.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ ans\ =\ sock.readHTTPChunk(20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of any HTTP footers received (with footer keys converted to lower case), with the body returned in the {\ttfamily "{}body"{}} key as a binary value
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a60ccf4dbef8657272a09a6003dfc2410}\label{class_qore_1_1_socket_a60ccf4dbef8657272a09a6003dfc2410} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunkedBody@{readHTTPChunkedBody}}
\index{readHTTPChunkedBody@{readHTTPChunkedBody}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunkedBody()}{readHTTPChunkedBody()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::read\+HTTPChunked\+Body (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ ans\ =\ sock.readHTTPChunkedBody(20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of any HTTP footers received (with footer keys converted to lower case), with the body returned in the {\ttfamily "{}body"{}} key as a string in the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a09f29e987023ebf27d6edd8fd2aa3bc9}\label{class_qore_1_1_socket_a09f29e987023ebf27d6edd8fd2aa3bc9} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunkedBodyBinary@{readHTTPChunkedBodyBinary}}
\index{readHTTPChunkedBodyBinary@{readHTTPChunkedBodyBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunkedBodyBinary()}{readHTTPChunkedBodyBinary()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::read\+HTTPChunked\+Body\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a binary object in the {\ttfamily "{}body"{}} key of a hash (including footers received) 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ ans\ =\ sock.readHTTPChunkedBodyBinary(20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of any HTTP footers received (with footer keys converted to lower case), with the body returned in the {\ttfamily "{}body"{}} key as a binary object
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_aa3c8f41a0879b440a999db5c55663d30}\label{class_qore_1_1_socket_aa3c8f41a0879b440a999db5c55663d30} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunkedBodyBinaryWithCallback@{readHTTPChunkedBodyBinaryWithCallback}}
\index{readHTTPChunkedBodyBinaryWithCallback@{readHTTPChunkedBodyBinaryWithCallback}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunkedBodyBinaryWithCallback()}{readHTTPChunkedBodyBinaryWithCallback()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::read\+HTTPChunked\+Body\+Binary\+With\+Callback (\begin{DoxyParamCaption}\item[{code}]{rcb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.readHTTPChunkedBodyBinaryWithCallback(recv\_callback,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em rcb} & The receive callback for the data received; first this method is called with a hash of the message headers, and then with any message body; if a chunked HTTP message is received, then the callback is called once for each chunk; when the message has been received, then the receive callback is called with a hash representing any trailer data received in a chunked transfer or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}data"{}}\+: the string or binary data
\item {\ttfamily "{}chunked"{}}\+: True if the data was received with chunked transfer encoding, False if not
\end{DoxyItemize}Header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}hdr"{}}\+: this can be assigned to \doxysectlink{basic_data_types_nothing}{NOTHING}{1} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily "{}obj"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding) 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+10 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a66e68401a9f1593a2580a0d25e491f2e}\label{class_qore_1_1_socket_a66e68401a9f1593a2580a0d25e491f2e} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunkedBodyToOutputStream@{readHTTPChunkedBodyToOutputStream}}
\index{readHTTPChunkedBodyToOutputStream@{readHTTPChunkedBodyToOutputStream}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunkedBodyToOutputStream()}{readHTTPChunkedBodyToOutputStream()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::read\+HTTPChunked\+Body\+To\+Output\+Stream (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}}}]{os,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in an HTTP message body sent in chunked transfer encoding, writes it in an \doxylink{class_qore_1_1_output_stream}{Output\+Stream} and returns any footers received. 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ ans\ =\ sock.readHTTPChunkedBodyToOutputStream(outputStream,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em os} & The output stream to write the response body to \\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of any HTTP footers received (with footer keys converted to lower case)
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a97ffc465250c06c5b4fbc512bd17ee64}\label{class_qore_1_1_socket_a97ffc465250c06c5b4fbc512bd17ee64} 
\index{Qore::Socket@{Qore::Socket}!readHTTPChunkedBodyWithCallback@{readHTTPChunkedBodyWithCallback}}
\index{readHTTPChunkedBodyWithCallback@{readHTTPChunkedBodyWithCallback}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPChunkedBodyWithCallback()}{readHTTPChunkedBodyWithCallback()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::read\+HTTPChunked\+Body\+With\+Callback (\begin{DoxyParamCaption}\item[{code}]{rcb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers received as a string in the {\ttfamily "{}body"{}} key of a hash (including footers received) 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.readHTTPChunkedBodyWithCallback(recv\_callback,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{EVENT\+\_\+\+HTTP\+\_\+\+CHUNK\+\_\+\+SIZE}{1}, \doxysectlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+FOOTERS\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em rcb} & The receive callback for the data received; first this method is called with a hash of the message headers, and then with any message body; if a chunked HTTP message is received, then the callback is called once for each chunk; when the message has been received, then the receive callback is called with a hash representing any trailer data received in a chunked transfer or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}data"{}}\+: the string or binary data
\item {\ttfamily "{}chunked"{}}\+: True if the data was received with chunked transfer encoding, False if not
\end{DoxyItemize}Header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}hdr"{}}\+: this can be assigned to \doxysectlink{basic_data_types_nothing}{NOTHING}{1} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily "{}obj"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding) 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em READ-\/\+HTTP-\/\+CHUNK-\/\+ERROR} & negative value given for chunk size by server\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+10 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}\label{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9} 
\index{Qore::Socket@{Qore::Socket}!readHTTPHeader@{readHTTPHeader}}
\index{readHTTPHeader@{readHTTPHeader}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPHeader()}{readHTTPHeader()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+Socket\+::read\+HTTPHeader (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info }\end{DoxyParamCaption})}



Retuns a hash representing the data in the HTTP header read, or, if the data cannot be parsed as an HTTP header, then an exception is thrown, and the data read is returned as a string in the {\ttfamily arg} key of the exception hash. 

If any errors occur reading from the socket or if invalid HTTP data is received, an exception is raised. Accepts an optional timeout value in milliseconds.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ ans\ =\ sock.readHTTPHeader(10s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}, \doxysectlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{EVENT\+\_\+\+HTTP\+\_\+\+MESSAGE\+\_\+\+RECEIVED}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.) \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with one of the following two keys\+:
\begin{DoxyItemize}
\item {\ttfamily headers-\/raw}\+: the raw headers read without any case conversions or other processing
\item {\ttfamily request-\/uri}\+: (only set when parsing a request header) gives the request URI in an HTTP request
\item {\ttfamily response-\/uri}\+: (only set when parsing a response header) gives the response URI in an HTTP response
\item {\ttfamily body-\/content-\/type}\+: this is the {\ttfamily "{}\+Content-\/\+Type"{}} header without any charset declaration
\item {\ttfamily charset\+:} if there is a charset declaration in the {\ttfamily "{}\+Content-\/\+Type"{}} header, the value is returned in this key
\item {\ttfamily close\+:} (only set when parsing a request header) set to \doxysectlink{basic_data_types_True}{True}{2} if the connection should be closed after responding, \doxysectlink{basic_data_types_False}{False}{2} if not; see notes below about how this value is calculated
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily "{}\+Accept-\/\+Charset"{}} header; if any of {\ttfamily "{}\texorpdfstring{$\ast$}{*}"{}}, {\ttfamily "{}utf8"{}}, or {\ttfamily "{}utf-\/8"{}} are present, then this will be set to {\ttfamily "{}utf8"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily accept-\/encoding}\+: this key will be set to a list of values from any {\ttfamily "{}\+Accept-\/\+Encoding"{}} header
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash of headers (where each header key is converted to lower-\/case) also including the following keys giving additional information about the HTTP header received\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} a string giving the HTTP version set in the header
\item {\ttfamily status\+\_\+code\+:} (HTTP responses only) an integer giving the status code
\item {\ttfamily status\+\_\+message\+:} (HTTP responses only) if present in an HTTP response, this key will be set to the message after the status code
\item {\ttfamily method\+:} (HTTP requests only) a string giving the HTTP method (i.\+e. {\ttfamily "{}\+GET"{}}, {\ttfamily "{}\+POST"{}}, etc)
\item {\ttfamily path\+:} (HTTP requests only) a string giving the path in a request without any decoding; use \doxylink{group__misc__functions_ga2f5349505d3d2563ef31f4d8b5c5f1b3}{decode\+\_\+url()} to decode if necessary
\end{DoxyItemize}
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em SOCKET-\/\+HTTP-\/\+ERROR} & Invalid HTTP data was received, in the case of invalid header info received, the {\ttfamily arg} key of the exception hash will have the invalid data received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item if the header claims a certain character encoding via a {\ttfamily charset} declaration in the {\ttfamily "{}\+Content-\/\+Type"{}} header, the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s \doxylink{character_encoding}{character encoding} is automatically set accordingly
\item \href{http://tools.ietf.org/html/rfc2616\#section-3.7.1}{\texttt{ RFC 2616 3.\+7.\+1}}\+: if no encoding is specified, then set {\ttfamily "{}iso-\/8859-\/1"{}} 
\item \href{http://tools.ietf.org/html/rfc2068\#section-19.7.1}{\texttt{ RFC 2068 19.\+7.\+1}}\+: Persistent connections in HTTP/1.\+0 must be explicitly negotiated as they are not the default behavior
\item \href{http://tools.ietf.org/html/rfc1945\#section-1.3}{\texttt{ RFC 1945 1.\+3}}\+: Except for experimental applications, current practice requires that the connection be established by the client prior to each request and closed by the server after sending the response.
\item the conclusion is that server applications MUST close the connection when a request is received by an HTTP 1.\+0 client without an explicit request to keep the connection open
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+4 this method always returns a hash and raises a {\ttfamily SOCKET-\/\+HTTP-\/\+ERROR} if invalid HTTP data is received
\item Qore 0.\+8.\+8 added the {\ttfamily close}, {\ttfamily charset}, {\ttfamily body-\/content-\/type}, and {\ttfamily accept-\/charset} info keys as well as the encoding handling based on the detected charset
\item Qore 0.\+9.\+3 added the {\ttfamily "{}headers-\/raw"{}} key in the output {\ttfamily info} hash 
\end{DoxyItemize}
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ac3e0f0383c3337783a49ff85d8805bad}\label{class_qore_1_1_socket_ac3e0f0383c3337783a49ff85d8805bad} 
\index{Qore::Socket@{Qore::Socket}!readHTTPHeaderString@{readHTTPHeaderString}}
\index{readHTTPHeaderString@{readHTTPHeaderString}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readHTTPHeaderString()}{readHTTPHeaderString()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::read\+HTTPHeader\+String (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Retuns a string representing the data in the HTTP header read (reads until {\ttfamily "{}\textbackslash{}r\textbackslash{}n\textbackslash{}r\textbackslash{}n"{}}) 

If any errors occur reading from the socket, an exception is raised. Accepts an optional timeout value in milliseconds.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string\ str\ =\ sock.readHTTPHeaderString(10s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a string representing the header data read
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket \\
\hline
{\em SOCKET-\/\+HTTP-\/\+ERROR} & maximum header size was exceeded\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a813896d93e94d548d18f1c5128d345a0}\label{class_qore_1_1_socket_a813896d93e94d548d18f1c5128d345a0} 
\index{Qore::Socket@{Qore::Socket}!readServerSentEvent@{readServerSentEvent}}
\index{readServerSentEvent@{readServerSentEvent}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readServerSentEvent()}{readServerSentEvent()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ Qore\+::\+Socket\+::read\+Server\+Sent\+Event (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{content\+\_\+encoding,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Read a server sent event message. 


\begin{DoxyParams}{Parameters}
{\em content\+\_\+encoding} & any content encoding to use to decode the stream (ex\+: {\ttfamily "{}deflate"{}}) \\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 2.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aeaadf2a4de58c22d15b6a277fdc49ce8}\label{class_qore_1_1_socket_aeaadf2a4de58c22d15b6a277fdc49ce8} 
\index{Qore::Socket@{Qore::Socket}!readServerSentEvent@{readServerSentEvent}}
\index{readServerSentEvent@{readServerSentEvent}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{readServerSentEvent()}{readServerSentEvent()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_sse_message_info}{Sse\+Message\+Info}} $>$ Qore\+::\+Socket\+::read\+Server\+Sent\+Event (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Read a server sent event message. 


\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & The remote end closed the connection without sending any data \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & There was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & The data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & There was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 2.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}\label{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8} 
\index{Qore::Socket@{Qore::Socket}!recv@{recv}}
\index{recv@{recv}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recv()}{recv()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::recv (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{size = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives data from the socket and returns a string tagged with the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s character encoding. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string\ data\ =\ sock.recv(-\/1);\ \textcolor{comment}{\#\ read\ all\ data\ available}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em size} & the amount of data to read in bytes; to read until the remote closes the connection, use -\/1; a value of 0 means to read all data currently available or available up until the timeout period (if non-\/negative) \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the data read, returned as a string tagged with the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s character encoding
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection. \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data. \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4}{Socket\+::set\+Encoding()}
\item \doxylink{class_qore_1_1_socket_aa255d1dcfbddb208e80684eebecc800d}{Socket\+::recv\+Binary()} 
\end{DoxyItemize}
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aa255d1dcfbddb208e80684eebecc800d}\label{class_qore_1_1_socket_aa255d1dcfbddb208e80684eebecc800d} 
\index{Qore::Socket@{Qore::Socket}!recvBinary@{recvBinary}}
\index{recvBinary@{recvBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvBinary()}{recvBinary()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::\+Socket\+::recv\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{size = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives data from the socket and returns a binary object. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{binary\ data\ =\ sock.recvBinary(-\/1);\ \textcolor{comment}{\#\ read\ all\ data\ available}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em size} & the amount of data to read in bytes; to read until the remote closes the connection, use -\/1; a value of 0 means to read all data currently available or available up until the timeout period (if non-\/negative) \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the data read, returned as a binary object
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection. \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data. \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{Socket\+::recv()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a9c362b07b1d06fce22bde3e6a888832d}\label{class_qore_1_1_socket_a9c362b07b1d06fce22bde3e6a888832d} 
\index{Qore::Socket@{Qore::Socket}!recvi1@{recvi1}}
\index{recvi1@{recvi1}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi1()}{recvi1()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi1 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 1-\/byte signed integer from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi1();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 1-\/byte signed integer read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ab77e7118003c6ae4baac594ffd91d980}{Socket\+::recvu1()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738}\label{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738} 
\index{Qore::Socket@{Qore::Socket}!recvi2@{recvi2}}
\index{recvi2@{recvi2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi2()}{recvi2()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 2-\/byte (16-\/bit) signed integer in big-\/endian format (network byte order) from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi2();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 2-\/byte signed integer in big-\/endian format (network byte order) read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e}{Socket\+::recvu2()}, \doxylink{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12}{Socket\+::recvi2\+LSB()}, \doxylink{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0}{Socket\+::recvu2\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12}\label{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12} 
\index{Qore::Socket@{Qore::Socket}!recvi2LSB@{recvi2LSB}}
\index{recvi2LSB@{recvi2LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi2LSB()}{recvi2LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi2\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 2-\/byte (16-\/bit) signed integer in little-\/endian format from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi2LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 2-\/byte signed integer in little-\/endian format read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738}{Socket\+::recvi2()}, \doxylink{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e}{Socket\+::recvu2()}, \doxylink{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0}{Socket\+::recvu2\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea}\label{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea} 
\index{Qore::Socket@{Qore::Socket}!recvi4@{recvi4}}
\index{recvi4@{recvi4}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi4()}{recvi4()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi4 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 4-\/byte (32-\/bit) signed integer in big-\/endian format (network byte order) from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi4();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 4-\/byte signed integer in big-\/endian format (network byte order) read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14}{Socket\+::recvu4()}, \doxylink{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c}{Socket\+::recvi4\+LSB()}, \doxylink{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a}{Socket\+::recvu4\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c}\label{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c} 
\index{Qore::Socket@{Qore::Socket}!recvi4LSB@{recvi4LSB}}
\index{recvi4LSB@{recvi4LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi4LSB()}{recvi4LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi4\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 4-\/byte (32-\/bit) signed integer in little-\/endian format from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi4LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 4-\/byte signed integer in little-\/endian format read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea}{Socket\+::recvi4()}, \doxylink{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14}{Socket\+::recvu4()}, \doxylink{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a}{Socket\+::recvu4\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_adc8295d79e2288b2e8c5143ac270d08c}\label{class_qore_1_1_socket_adc8295d79e2288b2e8c5143ac270d08c} 
\index{Qore::Socket@{Qore::Socket}!recvi8@{recvi8}}
\index{recvi8@{recvi8}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi8()}{recvi8()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi8 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives an 8-\/byte (64-\/bit) signed integer in big-\/endian format (network byte order) from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi8();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 8-\/byte signed integer in big-\/endian format (network byte order) read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a7d107840ba3dbac1bd621179a89b121a}{Socket\+::recvi8\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a7d107840ba3dbac1bd621179a89b121a}\label{class_qore_1_1_socket_a7d107840ba3dbac1bd621179a89b121a} 
\index{Qore::Socket@{Qore::Socket}!recvi8LSB@{recvi8LSB}}
\index{recvi8LSB@{recvi8LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvi8LSB()}{recvi8LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvi8\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives an 8-\/byte (64-\/bit) signed integer in little-\/endian format from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi8LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 8-\/byte signed integer in little-\/endian format read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adc8295d79e2288b2e8c5143ac270d08c}{Socket\+::recvi8()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a94c526792b88115ab62bdfa26a7ec48f}\label{class_qore_1_1_socket_a94c526792b88115ab62bdfa26a7ec48f} 
\index{Qore::Socket@{Qore::Socket}!recvToOutputStream@{recvToOutputStream}}
\index{recvToOutputStream@{recvToOutputStream}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvToOutputStream()}{recvToOutputStream()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::recv\+To\+Output\+Stream (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}}}]{os,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{size = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives data from the socket and writes the bytes to an \doxylink{class_qore_1_1_output_stream}{Output\+Stream}. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.recvToOutputStream(os,\ -\/1);\ \textcolor{comment}{\#\ read\ all\ data\ available}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em os} & The output stream to write the response body to \\
\hline
{\em size} & the amount of data to read in bytes; to read until the remote closes the connection, use -\/1 \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection. \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data. \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{Socket\+::recv()} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ab77e7118003c6ae4baac594ffd91d980}\label{class_qore_1_1_socket_ab77e7118003c6ae4baac594ffd91d980} 
\index{Qore::Socket@{Qore::Socket}!recvu1@{recvu1}}
\index{recvu1@{recvu1}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvu1()}{recvu1()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvu1 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 1-\/byte unsigned integer from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvu1();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 1-\/byte unsigned integer read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a9c362b07b1d06fce22bde3e6a888832d}{Socket\+::recvi1()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e}\label{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e} 
\index{Qore::Socket@{Qore::Socket}!recvu2@{recvu2}}
\index{recvu2@{recvu2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvu2()}{recvu2()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvu2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 2-\/byte (16-\/bit) unsigned integer in big-\/endian format (network byte order) from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvu2();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 2-\/byte unsigned integer in big-\/endian format (network byte order) read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738}{Socket\+::recvi2()}, \doxylink{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12}{Socket\+::recvi2\+LSB()}, \doxylink{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0}{Socket\+::recvu2\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0}\label{class_qore_1_1_socket_aa1ea4a31ed5e4a0c1858bfd4e754eee0} 
\index{Qore::Socket@{Qore::Socket}!recvu2LSB@{recvu2LSB}}
\index{recvu2LSB@{recvu2LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvu2LSB()}{recvu2LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvu2\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 2-\/byte (16-\/bit) unsigned integer in little-\/endian format from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvi2LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 2-\/byte unsigned integer in little-\/endian format read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a4fba2fa5a88c8c9694c3557056116738}{Socket\+::recvi2()}, \doxylink{class_qore_1_1_socket_a2866c8093c3cdd5216bf01c768054e7e}{Socket\+::recvu2()}, \doxylink{class_qore_1_1_socket_ae243f8377cd00cf9be553a1cefc27b12}{Socket\+::recvi2\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14}\label{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14} 
\index{Qore::Socket@{Qore::Socket}!recvu4@{recvu4}}
\index{recvu4@{recvu4}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvu4()}{recvu4()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvu4 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 4-\/byte (32-\/bit) unsigned integer in big-\/endian format (network byte order) from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvu4();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 4-\/byte unsigned integer in big-\/endian format (network byte order) read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea}{Socket\+::recvi4()}, \doxylink{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c}{Socket\+::recvi4\+LSB()}, \doxylink{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a}{Socket\+::recvu4\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a}\label{class_qore_1_1_socket_a4cd9d50e0649da38ee3292e349f22b7a} 
\index{Qore::Socket@{Qore::Socket}!recvu4LSB@{recvu4LSB}}
\index{recvu4LSB@{recvu4LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{recvu4LSB()}{recvu4LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::recvu4\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Receives a 4-\/byte (32-\/bit) unsigned integer in little-\/endian format from the socket. 

If any errors occur reading from the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ val\ =\ sock.recvu4LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_READ}{EVENT\+\_\+\+PACKET\+\_\+\+READ}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The 4-\/byte unsigned integer in little-\/endian format read; if any errors occur reading from the socket, an exception is raised
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+CLOSED} & the remote end has closed the connection \\
\hline
{\em SOCKET-\/\+RECV-\/\+ERROR} & there was an error receiving the data \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while reading data from the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ac8ca3e12a7616dcad149754ffe8342ea}{Socket\+::recvi4()}, \doxylink{class_qore_1_1_socket_adbd053f544a6da11c74fa489ac1bbc14}{Socket\+::recvu4()}, \doxylink{class_qore_1_1_socket_a6101e09f33fe75e8404c612177fff54c}{Socket\+::recvi4\+LSB()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}\label{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86} 
\index{Qore::Socket@{Qore::Socket}!send@{send}}
\index{send@{send}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{send()}{send()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{bin,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends binary data over the socket; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.send(data,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em bin} & Sends the binary data over the socket \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9}{Socket\+::send\+Binary()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()} except for the return value
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error like \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aa2fbea3740e4195c06f78e35f36da966}\label{class_qore_1_1_socket_aa2fbea3740e4195c06f78e35f36da966} 
\index{Qore::Socket@{Qore::Socket}!send@{send}}
\index{send@{send}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{send()}{send()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends string data over the socket; string data is converted to the socket\textquotesingle{}s encoding if necessary; if any errors occur, an exception is thrown. 

String data will be converted to the encoding set for the socket if necessary.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.send(str,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em str} & sends the string data over the socket without the trailing null (\textquotesingle{}\textbackslash{}0\textquotesingle{}) character; the string\textquotesingle{}s encoding is converted to the socket\textquotesingle{}s encoding if necessary \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{Socket\+::send\+Binary2()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()} except for the return value
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error like \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}\label{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef} 
\index{Qore::Socket@{Qore::Socket}!send2@{send2}}
\index{send2@{send2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{send2()}{send2()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{bin,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends binary data over the socket; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.send2(data);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em bin} & Sends the binary data over the socket \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{Socket\+::send\+Binary2()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{Socket\+::send()} except for the lack of a return value (since errors cause exceptions to be thrown, no return value is necessary)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a023cbc8f4aae2e34364d3df6930fa220}\label{class_qore_1_1_socket_a023cbc8f4aae2e34364d3df6930fa220} 
\index{Qore::Socket@{Qore::Socket}!send2@{send2}}
\index{send2@{send2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{send2()}{send2()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends string data over the socket; string data is converted to the socket\textquotesingle{}s encoding if necessary; if any errors occur, an exception is thrown. 

String data will be converted to the encoding set for the socket if necessary.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.send2(str);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em str} & sends the string data over the socket without the trailing null (\textquotesingle{}\textbackslash{}0\textquotesingle{}) character; the string\textquotesingle{}s encoding is converted to the socket\textquotesingle{}s encoding if necessary \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{Socket\+::send\+Binary2()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{Socket\+::send()} except for the lack of a return value (since errors cause exceptions to be thrown, no return value is necessary)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a0e80d3a58b2e82f3620c06fec63db05f}\label{class_qore_1_1_socket_a0e80d3a58b2e82f3620c06fec63db05f} 
\index{Qore::Socket@{Qore::Socket}!sendBinary@{sendBinary}}
\index{sendBinary@{sendBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendBinary()}{sendBinary()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::send\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{bin,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends binary data over the socket; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendBinary2(data);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em bin} & Sends the binary data over the socket \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{Socket\+::send\+Binary2()} except for the return value
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error like \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9}\label{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9} 
\index{Qore::Socket@{Qore::Socket}!sendBinary@{sendBinary}}
\index{sendBinary@{sendBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendBinary()}{sendBinary()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::send\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends string data over the socket without converting the string to the socket\textquotesingle{}s encoding, but instead is sent exactly as-\/is; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendBinary(str);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em str} & string data to be sent (without any conversion to the socket\textquotesingle{}s encoding) over the socket without the trailing null (\textquotesingle{}\textbackslash{}0\textquotesingle{}) character \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}{Socket\+::send\+Binary2()} except for the return value
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error like \doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a87dc2b71ee071f8d76a96cd4a4092e21}\label{class_qore_1_1_socket_a87dc2b71ee071f8d76a96cd4a4092e21} 
\index{Qore::Socket@{Qore::Socket}!sendBinary2@{sendBinary2}}
\index{sendBinary2@{sendBinary2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendBinary2()}{sendBinary2()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+Binary2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{bin,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends binary data over the socket; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendBinary2(data);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em bin} & Sends the binary data over the socket \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9}{Socket\+::send\+Binary()} except for the lack of a return value (since errors cause exceptions to be thrown, no return value is necessary)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f}\label{class_qore_1_1_socket_a681a441f39cea6a337902a90f4cc897f} 
\index{Qore::Socket@{Qore::Socket}!sendBinary2@{sendBinary2}}
\index{sendBinary2@{sendBinary2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendBinary2()}{sendBinary2()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+Binary2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{str,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends string data over the socket without converting the string to the socket\textquotesingle{}s encoding, but instead is sent exactly as-\/is; if any errors occur, an exception is thrown. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendBinary2(str);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em str} & string data to be sent (without any conversion to the socket\textquotesingle{}s encoding) over the socket without the trailing null (\textquotesingle{}\textbackslash{}0\textquotesingle{}) character \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_ab98b2101a71b7660d6d2bad57988d0ef}{Socket\+::send2()}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
this method is as of Qore 0.\+8.\+6+ equivalent to \doxylink{class_qore_1_1_socket_ada01381996dde5eb7dda1562f43fbda9}{Socket\+::send\+Binary()} except for the lack of a return value (since errors cause exceptions to be thrown, no return value is necessary)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a405089a14054f20f9c1a7132bc2873bc}\label{class_qore_1_1_socket_a405089a14054f20f9c1a7132bc2873bc} 
\index{Qore::Socket@{Qore::Socket}!sendFromInputStream@{sendFromInputStream}}
\index{sendFromInputStream@{sendFromInputStream}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendFromInputStream()}{sendFromInputStream()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+From\+Input\+Stream (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{input\+\_\+stream,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{size = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads data from an \doxylink{class_qore_1_1_input_stream}{Input\+Stream} and sends the bytes over the socket. 

If any errors occur writing to the socket, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendFromInputStream(input\_stream,\ -\/1);\ \textcolor{comment}{\#\ write\ all\ data\ available}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em input\+\_\+stream} & the \doxylink{class_qore_1_1_input_stream}{Input\+Stream} providing the data to send \\
\hline
{\em size} & the amount of data to send in bytes; to send all data available in the \doxylink{class_qore_1_1_input_stream}{Input\+Stream}, use -\/1 \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_af9d1cff50c37b6a92b6ce60357f3593c}\label{class_qore_1_1_socket_af9d1cff50c37b6a92b6ce60357f3593c} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPChunkedBodyFromInputStream@{sendHTTPChunkedBodyFromInputStream}}
\index{sendHTTPChunkedBodyFromInputStream@{sendHTTPChunkedBodyFromInputStream}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPChunkedBodyFromInputStream()}{sendHTTPChunkedBodyFromInputStream()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPChunked\+Body\+From\+Input\+Stream (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{input\+\_\+stream,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{max\+\_\+chunk\+\_\+size = {\ttfamily 4096},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} code}]{tcb }\end{DoxyParamCaption})}



Sends an HTTP message body in chunked transfer encoding. 

If any errors are encountered, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPChunkedBodyFromInputStream(inputStream);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em input\+\_\+stream} & The input stream to read data from \\
\hline
{\em max\+\_\+chunk\+\_\+size} & the maximum chunk size as the read block size for the \doxylink{class_qore_1_1_input_stream}{Input\+Stream} read block size; the actual size of the data read will determine the size of each HTTP chunk \\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.) \\
\hline
{\em tcb} & An optional trailer callback for message trailers to write in the outgoing chunked message; the callback takes no arguments and must return either \doxysectlink{basic_data_types_nothing}{NOTHING}{1} or \doxysectlink{data_type_declarations_hash_type}{hash}{1} giving a hash of trailers for the final chunk\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed \\
\hline
{\em HTTP-\/\+CHUNK-\/\+ERROR} & the chunk size given is not greater than 0 \\
\hline
{\em HTTP-\/\+TRAILER-\/\+ERROR} & the trailer callback must return either \doxysectlink{basic_data_types_nothing}{NOTHING}{1} or \doxysectlink{data_type_declarations_hash_type}{hash}{1}; this exception is thrown is another type is returned\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ad4350c9346e37d5f9ece9578718efd6c}\label{class_qore_1_1_socket_ad4350c9346e37d5f9ece9578718efd6c} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPChunkedBodyTrailer@{sendHTTPChunkedBodyTrailer}}
\index{sendHTTPChunkedBodyTrailer@{sendHTTPChunkedBodyTrailer}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPChunkedBodyTrailer()}{sendHTTPChunkedBodyTrailer()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPChunked\+Body\+Trailer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{trailer,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends the trialer of an HTTP message body in chunked transfer encoding. 

If any errors are encountered, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPChunkedBodyTrailer(\{\});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em trailer} & optional trailer data \\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a1124aa106dc7585c0e2e18860e1c420d}\label{class_qore_1_1_socket_a1124aa106dc7585c0e2e18860e1c420d} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPMessage@{sendHTTPMessage}}
\index{sendHTTPMessage@{sendHTTPMessage}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPMessage()}{sendHTTPMessage()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPMessage (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. 

Creates a properly-\/formatted HTTP message and sends it over the \doxylink{class_qore_1_1_socket}{Socket}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPMessage(\textcolor{stringliteral}{"{}POST"{}},\ \textcolor{stringliteral}{"{}/RPC2"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ (\textcolor{stringliteral}{"{}Content-\/Type"{}}\ :\ \textcolor{stringliteral}{"{}text/xml"{}}),\ xml);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em method} & the HTTP method name to send (i.\+e. POST, HEAD, etc) \\
\hline
{\em path} & the path component of the URL \\
\hline
{\em http\+\_\+version} & the HTTP protocol version ({\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & if it does not have a length of zero, the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set) \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily request-\/uri}\+: The request URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & Send failed \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an error sending SSL data\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d}{Socket\+::send\+HTTPResponse()}, \doxylink{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}{Socket\+::read\+HTTPHeader()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_adf437ed165c08a1d166756ebe7b5ed4d}\label{class_qore_1_1_socket_adf437ed165c08a1d166756ebe7b5ed4d} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPMessage@{sendHTTPMessage}}
\index{sendHTTPMessage@{sendHTTPMessage}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPMessage()}{sendHTTPMessage()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPMessage (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}} $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. 

Creates a properly-\/formatted HTTP message and sends it over the \doxylink{class_qore_1_1_socket}{Socket}. To send a string without converting the encoding to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding, convert the string to a binary object using the \doxylink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary()} function and use the variant of this method that takes a binary object for the data argument.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPMessage(\textcolor{stringliteral}{"{}POST"{}},\ \textcolor{stringliteral}{"{}/RPC2"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ (\textcolor{stringliteral}{"{}Content-\/Type"{}}\ :\ \textcolor{stringliteral}{"{}text/xml"{}}),\ xml);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em method} & the HTTP method name to send (i.\+e. POST, HEAD, etc) \\
\hline
{\em path} & the path component of the URL \\
\hline
{\em http\+\_\+version} & the HTTP protocol version ({\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set); string data will be automatically converted to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding if necessary \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily request-\/uri}\+: The request URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & Send failed \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an error sending SSL data\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d}{Socket\+::send\+HTTPResponse()}, \doxylink{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}{Socket\+::read\+HTTPHeader()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aad057db5dddad2562a8c09a6cf0af543}\label{class_qore_1_1_socket_aad057db5dddad2562a8c09a6cf0af543} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPMessageWithCallback@{sendHTTPMessageWithCallback}}
\index{sendHTTPMessageWithCallback@{sendHTTPMessageWithCallback}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPMessageWithCallback()}{sendHTTPMessageWithCallback()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPMessage\+With\+Callback (\begin{DoxyParamCaption}\item[{code}]{scb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP message with a method and user-\/defined headers given as a hash and an optional message body. 

Creates a properly-\/formatted HTTP message and sends it over the \doxylink{class_qore_1_1_socket}{Socket}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPMessageWithCallback(send\_callback,\ \textcolor{stringliteral}{"{}POST"{}},\ \textcolor{stringliteral}{"{}/RPC2"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ (\textcolor{stringliteral}{"{}Content-\/Type"{}}\ :\ \textcolor{stringliteral}{"{}text/xml"{}}));}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em scb} & The callback giving the chunked HTTP data to send; this callback must return either a string or a binary value each time it is called to give the chunked data to send; when all data has been sent, then a hash of message trailers can be sent or simply \doxysectlink{basic_data_types_nothing}{NOTHING}{1} which will close the chunked message \\
\hline
{\em method} & the HTTP method name to send (i.\+e. POST, HEAD, etc) \\
\hline
{\em path} & the path component of the URL \\
\hline
{\em http\+\_\+version} & the HTTP protocol version ({\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily request-\/uri}\+: The request URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & Send failed \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an error sending SSL data\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d}{Socket\+::send\+HTTPResponse()}, \doxylink{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}{Socket\+::read\+HTTPHeader()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+10 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a15dd0f366b67539f2bed19ec4d36e87d}\label{class_qore_1_1_socket_a15dd0f366b67539f2bed19ec4d36e87d} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponse@{sendHTTPResponse}}
\index{sendHTTPResponse@{sendHTTPResponse}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponse()}{sendHTTPResponse()}\hspace{0.1cm}{\footnotesize\ttfamily [1/5]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and a message body as literal binary data. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponse(200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ \{\textcolor{stringliteral}{"{}Connection"{}}:\textcolor{stringliteral}{"{}Keep-\/Alive"{}}\},\ bin);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & if the binary object given does not have a length of zero, the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set) \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily response-\/uri}\+: The response URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ae615dc93d0c645f351a843cee7249ada}\label{class_qore_1_1_socket_ae615dc93d0c645f351a843cee7249ada} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponse@{sendHTTPResponse}}
\index{sendHTTPResponse@{sendHTTPResponse}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponse()}{sendHTTPResponse()}\hspace{0.1cm}{\footnotesize\ttfamily [2/5]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and a message body as literal binary data. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponse(200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ \{\textcolor{stringliteral}{"{}Connection"{}}:\textcolor{stringliteral}{"{}Keep-\/Alive"{}}\},\ bin);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & if the binary object given does not have a length of zero, the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set) \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a85f188ec83afbfb2068d742092f58042}\label{class_qore_1_1_socket_a85f188ec83afbfb2068d742092f58042} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponse@{sendHTTPResponse}}
\index{sendHTTPResponse@{sendHTTPResponse}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponse()}{sendHTTPResponse()}\hspace{0.1cm}{\footnotesize\ttfamily [3/5]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{input\+\_\+stream,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{max\+\_\+chunk\+\_\+size = {\ttfamily 4096},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} code}]{tcb }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers and a message body from an input stream in chunked transfer encoding. 

If any errors are encountered, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponse(200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ \{\textcolor{stringliteral}{"{}Connection"{}}:\ \textcolor{stringliteral}{"{}Keep-\/Alive"{}},\ \textcolor{stringliteral}{"{}Transfer-\/Encoding"{}}:\ \textcolor{stringliteral}{"{}chunked"{}}\},\ inputStream);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs); note that the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually with this call \\
\hline
{\em input\+\_\+stream} & The input stream to read data from \\
\hline
{\em max\+\_\+chunk\+\_\+size} & the maximum chunk size as the read block size for the \doxylink{class_qore_1_1_input_stream}{Input\+Stream} read block size; the actual size of the data read will determine the size of each HTTP chunk \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily response-\/uri}\+: The response URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & The timeout in milliseconds (1/1000 second). If no timeout or if a negative timeout is passed, then the call will not time out and will not return until all the data has been read or the remote end closes the connection. If a timeout occurs, a {\ttfamily "{}\+SOCKET-\/\+TIMEOUT"{}} exception is raised. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.) \\
\hline
{\em tcb} & An optional trailer callback for message trailers to write in the outgoing chunked message; the callback takes no arguments and must return either \doxysectlink{basic_data_types_nothing}{NOTHING}{1} or \doxysectlink{data_type_declarations_hash_type}{hash}{1} giving a hash of trailers for the final chunk\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually in the {\itshape headers} argument as in the example
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed \\
\hline
{\em HTTP-\/\+CHUNK-\/\+ERROR} & the chunk size given is not greater than 0 \\
\hline
{\em HTTP-\/\+TRAILER-\/\+ERROR} & the trailer callback must return either \doxysectlink{basic_data_types_nothing}{NOTHING}{1} or \doxysectlink{data_type_declarations_hash_type}{hash}{1}; this exception is thrown is another type is returned\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_af93b262da988c84136afe94cab278a14}\label{class_qore_1_1_socket_af93b262da988c84136afe94cab278a14} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponse@{sendHTTPResponse}}
\index{sendHTTPResponse@{sendHTTPResponse}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponse()}{sendHTTPResponse()}\hspace{0.1cm}{\footnotesize\ttfamily [4/5]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and an optional message body. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised. To send a string without converting the encoding to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding, convert the string to a binary object using the \doxylink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary()} function and use the variant of this method that takes a binary object for the data argument.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponse(200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ (\textcolor{stringliteral}{"{}Connection"{}}:\textcolor{stringliteral}{"{}Keep-\/Alive"{}}));}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & if present (and does not have a length of zero), the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set); string data will be automatically converted to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding if necessary \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily response-\/uri}\+: The response URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d}\label{class_qore_1_1_socket_a3e3d6f1bda0a9b6aaf92c5859c94a01d} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponse@{sendHTTPResponse}}
\index{sendHTTPResponse@{sendHTTPResponse}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponse()}{sendHTTPResponse()}\hspace{0.1cm}{\footnotesize\ttfamily [5/5]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and an optional message body. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised. To send a string without converting the encoding to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding, convert the string to a binary object using the \doxylink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary()} function and use the variant of this method that takes a binary object for the data argument.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponse(200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ (\textcolor{stringliteral}{"{}Connection"{}}:\textcolor{stringliteral}{"{}Keep-\/Alive"{}}));}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs) \\
\hline
{\em body} & if present (and does not have a length of zero), the body to be sent with the message (if present, the {\ttfamily "{}\+Content-\/\+Length"{}} header will be automatically set); string data will be automatically converted to the \doxylink{class_qore_1_1_socket}{Socket}\textquotesingle{}s encoding if necessary \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a5f5a90c335a060f916e3196810b60195}\label{class_qore_1_1_socket_a5f5a90c335a060f916e3196810b60195} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponseWithCallback@{sendHTTPResponseWithCallback}}
\index{sendHTTPResponseWithCallback@{sendHTTPResponseWithCallback}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponseWithCallback()}{sendHTTPResponseWithCallback()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse\+With\+Callback (\begin{DoxyParamCaption}\item[{code}]{scb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{reference}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ $>$}]{info,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and a message body to send with chunked transfer encoding provided by a callback. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponseWithCallback(send\_callback,\ 200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ \{\textcolor{stringliteral}{"{}Connection"{}}:\ \textcolor{stringliteral}{"{}Keep-\/Alive"{}},\ \textcolor{stringliteral}{"{}Transfer-\/Encoding"{}}:\ \textcolor{stringliteral}{"{}chunked"{}}\});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em scb} & The callback giving the chunked HTTP data to send; this callback must return either a string or a binary value each time it is called to give the chunked data to send; when all data has been sent, then a hash of message trailers can be sent or simply \doxysectlink{basic_data_types_nothing}{NOTHING}{1} which will close the chunked message \\
\hline
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs); note that the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually with this call \\
\hline
{\em info} & An optional reference to an lvalue that can accept a hash that will be used as an output variable with the following hash key\+:
\begin{DoxyItemize}
\item {\ttfamily response-\/uri}\+: The response URI as sent in the output message 
\end{DoxyItemize}\\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually in the {\itshape headers} argument as in the example
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a43ee02b46ffe20bc219a65c72944386f}\label{class_qore_1_1_socket_a43ee02b46ffe20bc219a65c72944386f} 
\index{Qore::Socket@{Qore::Socket}!sendHTTPResponseWithCallback@{sendHTTPResponseWithCallback}}
\index{sendHTTPResponseWithCallback@{sendHTTPResponseWithCallback}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendHTTPResponseWithCallback()}{sendHTTPResponseWithCallback()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::send\+HTTPResponse\+With\+Callback (\begin{DoxyParamCaption}\item[{code}]{scb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{status\+\_\+code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{status\+\_\+desc,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{http\+\_\+version,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$}]{headers,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an HTTP response with user-\/defined headers given as a hash and a message body to send with chunked transfer encoding provided by a callback. 

Creates a properly-\/formatted HTTP response message and sends it over the \doxylink{class_qore_1_1_socket}{Socket} (must already be connected). If any errors occur, an exception is raised.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendHTTPResponseWithCallback(send\_callback,\ 200,\ \textcolor{stringliteral}{"{}OK"{}},\ \textcolor{stringliteral}{"{}1.1"{}},\ \{\textcolor{stringliteral}{"{}Connection"{}}:\ \textcolor{stringliteral}{"{}Keep-\/Alive"{}},\ \textcolor{stringliteral}{"{}Transfer-\/Encoding"{}}:\ \textcolor{stringliteral}{"{}chunked"{}}\});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}, \doxysectlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{EVENT\+\_\+\+HTTP\+\_\+\+SEND\+\_\+\+MESSAGE}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em scb} & The callback giving the chunked HTTP data to send; this callback must return either a string or a binary value each time it is called to give the chunked data to send; when all data has been sent, then a hash of message trailers can be sent or simply \doxysectlink{basic_data_types_nothing}{NOTHING}{1} which will close the chunked message \\
\hline
{\em status\+\_\+code} & the HTTP status code to send (i.\+e. {\ttfamily 200}, {\ttfamily 404}, etc) \\
\hline
{\em status\+\_\+desc} & the descriptive text for the status code. \\
\hline
{\em http\+\_\+version} & the HTTP protocol version (normally {\ttfamily "{}1.\+0"{}} or {\ttfamily "{}1.\+1"{}}, however this method allows any string to be sent) \\
\hline
{\em headers} & a hash of additional headers to send (key-\/value pairs); note that the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually with this call \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second); If no timeout is passed or is negative, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
the {\ttfamily "{}\+Transfer-\/\+Encoding"{}} header must be set to {\ttfamily "{}chunked"{}} manually in the {\itshape headers} argument as in the example
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SENDHTTPRESPONSE-\/\+STATUS-\/\+ERROR} & raised if the status\+\_\+code (first argument) is \texorpdfstring{$<$}{<} 100 or \texorpdfstring{$>$}{>} 599 \\
\hline
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & the data requested was not received in the timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & send failed\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+10 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a13a4582d75efdb29305b1b54bf66b31b}\label{class_qore_1_1_socket_a13a4582d75efdb29305b1b54bf66b31b} 
\index{Qore::Socket@{Qore::Socket}!sendi1@{sendi1}}
\index{sendi1@{sendi1}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi1()}{sendi1()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi1 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends a 1-\/byte integer over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi1(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send; only the least-\/significant byte will be sent \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aaa62ba419d66dac29d8605c6dd5a7e68}\label{class_qore_1_1_socket_aaa62ba419d66dac29d8605c6dd5a7e68} 
\index{Qore::Socket@{Qore::Socket}!sendi2@{sendi2}}
\index{sendi2@{sendi2}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi2()}{sendi2()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi2 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends a 2-\/byte (16-\/bit) integer in big-\/endian format (network byte order) over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi2(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send; only the least-\/significant 2 bytes will be sent \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a0139b7e63ce4d06edecdb96d64124511}\label{class_qore_1_1_socket_a0139b7e63ce4d06edecdb96d64124511} 
\index{Qore::Socket@{Qore::Socket}!sendi2LSB@{sendi2LSB}}
\index{sendi2LSB@{sendi2LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi2LSB()}{sendi2LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi2\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends a 2-\/byte (16-\/bit) integer in little-\/endian format over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi2LSB(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send; only the least-\/significant 2 bytes will be sent \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a88a630d0cda97256c4b01c1e8b71d6e3}\label{class_qore_1_1_socket_a88a630d0cda97256c4b01c1e8b71d6e3} 
\index{Qore::Socket@{Qore::Socket}!sendi4@{sendi4}}
\index{sendi4@{sendi4}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi4()}{sendi4()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi4 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends a 4-\/byte (32-\/bit) integer in big-\/endian format (network byte order) over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi4(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send; only the least-\/significant 4 bytes will be sent \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a69c50668b38e98af23ab9fb07ce9adff}\label{class_qore_1_1_socket_a69c50668b38e98af23ab9fb07ce9adff} 
\index{Qore::Socket@{Qore::Socket}!sendi4LSB@{sendi4LSB}}
\index{sendi4LSB@{sendi4LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi4LSB()}{sendi4LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi4\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends a 4-\/byte (32-\/bit) integer in little-\/endian format over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi4LSB(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send; only the least-\/significant 4 bytes will be sent \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a8820f3ae73f1ce737aaf88b9cfb3c001}\label{class_qore_1_1_socket_a8820f3ae73f1ce737aaf88b9cfb3c001} 
\index{Qore::Socket@{Qore::Socket}!sendi8@{sendi8}}
\index{sendi8@{sendi8}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi8()}{sendi8()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi8 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an 8-\/byte (64-\/bit) integer in big-\/endian format (network byte order) over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi8(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a142489a333f9444b7379ad5b2a365780}\label{class_qore_1_1_socket_a142489a333f9444b7379ad5b2a365780} 
\index{Qore::Socket@{Qore::Socket}!sendi8LSB@{sendi8LSB}}
\index{sendi8LSB@{sendi8LSB}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{sendi8LSB()}{sendi8LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::sendi8\+LSB (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{softint}}}]{i = {\ttfamily 0},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sends an 8-\/byte (64-\/bit) integer in little-\/endian format over the socket. 

If any errors occur, an exception is thrown

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.sendi8LSB(val,\ 20s);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\doxysectlink{event_handling_EVENT_PACKET_SENT}{EVENT\+\_\+\+PACKET\+\_\+\+SENT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em i} & the integer to send \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds (1/1000 second). If no timeout is passed, then the call will not time out and will not return until all the data has been sent or the remote end closes the connection; the timeout value is the longest value that a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation can take with non-\/blocking I/O. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
always returns 0 for backwards compatibility; if an error occurs, an exception is thrown
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & The socket is not connected \\
\hline
{\em SOCKET-\/\+TIMEOUT} & a single \doxylink{class_qore_1_1_socket_aa5937114e3c3339bf463303d4208ca86}{send()} operation exceeded the given timeout period \\
\hline
{\em SOCKET-\/\+SEND-\/\+ERROR} & an error occurred sending the socket data \\
\hline
{\em SOCKET-\/\+SSL-\/\+ERROR} & there was an SSL error while writing data to the socket\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 this method takes a timeout value and throws exceptions on error; this change was made because it was not possible to catch SSL errors with this method with the previous implementation 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a3f7bfccfea1d522e64e2e5a959d0abba}\label{class_qore_1_1_socket_a3f7bfccfea1d522e64e2e5a959d0abba} 
\index{Qore::Socket@{Qore::Socket}!setCertificate@{setCertificate}}
\index{setCertificate@{setCertificate}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setCertificate()}{setCertificate()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Certificate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{cert\+\_\+der }\end{DoxyParamCaption})}



Sets the X.\+509 certificate to use for negotiating encrypted connections from the DER-\/encoded binary object representing the X.\+509 certificate. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setCertificate(cert\_der);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em cert\+\_\+der} & the DER-\/encoded binary object representing the X.\+509 certificate \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_a9635916d0570c939002ab206cb0f52de}\label{class_qore_1_1_socket_a9635916d0570c939002ab206cb0f52de} 
\index{Qore::Socket@{Qore::Socket}!setCertificate@{setCertificate}}
\index{setCertificate@{setCertificate}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setCertificate()}{setCertificate()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Certificate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}}}]{cert }\end{DoxyParamCaption})}



Sets the X.\+509 certificate to use for negotiating encrypted connections. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setCertificate(cert);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em cert} & This must be an \doxylink{class_qore_1_1_s_s_l_certificate}{SSLCertificate} object \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_aa0fe25d00f6907cfa98612c9ff2b62c6}\label{class_qore_1_1_socket_aa0fe25d00f6907cfa98612c9ff2b62c6} 
\index{Qore::Socket@{Qore::Socket}!setCertificate@{setCertificate}}
\index{setCertificate@{setCertificate}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setCertificate()}{setCertificate()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Certificate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{cert\+\_\+pem }\end{DoxyParamCaption})}



Sets the X.\+509 certificate to use for negotiating encrypted connections from the PEM-\/encoded string representing the X.\+509 certificate. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setCertificate(cert\_string);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em cert\+\_\+pem} & the PEM-\/encoded string representing the X.\+509 certificate \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_a5cc870765d200c1b3df7c639db47885e}\label{class_qore_1_1_socket_a5cc870765d200c1b3df7c639db47885e} 
\index{Qore::Socket@{Qore::Socket}!setCertificateAndPrivateKey@{setCertificateAndPrivateKey}}
\index{setCertificateAndPrivateKey@{setCertificateAndPrivateKey}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setCertificateAndPrivateKey()}{setCertificateAndPrivateKey()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Certificate\+And\+Private\+Key (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_s_s_l_certificate}{SSLCertificate}}}]{cert,  }\item[{\mbox{\hyperlink{class_qore_1_1_s_s_l_private_key}{SSLPrivate\+Key}}}]{key }\end{DoxyParamCaption})}



Sets the X.\+509 certificate and private key in one atomic operation to use for negotiating encrypted connections. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setCertificateAndPrivateKey(cert,\ key);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em cert} & This must be an \doxylink{class_qore_1_1_s_s_l_certificate}{SSLCertificate} object \\
\hline
{\em key} & This must be an Qore\+SSLPrivate\+Key object\\
\hline
\end{DoxyParams}
\begin{DoxySince}{Since}
Qore 1.\+11.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ad5685173c314f4d5905b6d6ce4487479}\label{class_qore_1_1_socket_ad5685173c314f4d5905b6d6ce4487479} 
\index{Qore::Socket@{Qore::Socket}!setCharset@{setCharset}}
\index{setCharset@{setCharset}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setCharset()}{setCharset()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Charset (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding }\end{DoxyParamCaption})}



Sets the \doxylink{character_encoding}{character encoding} for the socket. 

A method synonym for \doxylink{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4}{Socket\+::set\+Encoding()}, kept for backwards-\/compatibility 
\begin{DoxyParams}{Parameters}
{\em encoding} & The \doxylink{character_encoding}{character encoding} for the socket \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4}\label{class_qore_1_1_socket_af48a09edcb2db8dd8fa0e0d85a6fece4} 
\index{Qore::Socket@{Qore::Socket}!setEncoding@{setEncoding}}
\index{setEncoding@{setEncoding}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setEncoding()}{setEncoding()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Encoding (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding }\end{DoxyParamCaption})}



Sets the \doxylink{character_encoding}{character encoding} for the socket. 


\begin{DoxyParams}{Parameters}
{\em encoding} & the \doxylink{character_encoding}{character encoding} for the socket \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_ad1259b25b8b8533d042a1f7bc29894b1}\label{class_qore_1_1_socket_ad1259b25b8b8533d042a1f7bc29894b1} 
\index{Qore::Socket@{Qore::Socket}!setEventQueue@{setEventQueue}}
\index{setEventQueue@{setEventQueue}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setEventQueue()}{setEventQueue()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Event\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Removes any \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object from the \doxylink{class_qore_1_1_socket}{Socket} object so that \doxylink{class_qore_1_1_socket_socket_events}{socket events} are no longer added to the \doxylink{class_qore_1_1_thread_1_1_queue}{Queue}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setEventQueue();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\doxylink{event_handling}{I/O Event Handling} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{for} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{more} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{information} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_ab639fa7679cf964790d69773512eb7c7}\label{class_qore_1_1_socket_ab639fa7679cf964790d69773512eb7c7} 
\index{Qore::Socket@{Qore::Socket}!setEventQueue@{setEventQueue}}
\index{setEventQueue@{setEventQueue}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setEventQueue()}{setEventQueue()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Event\+Queue (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Qore\+::\+Thread\+::\+Queue}}}]{queue,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}}}]{arg,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{with\+\_\+data }\end{DoxyParamCaption})}



Sets a \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive \doxylink{class_qore_1_1_socket_socket_events}{socket events}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setEventQueue(queue);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em queue} & the \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive \doxylink{class_qore_1_1_socket_socket_events}{socket events}; note that the Queue passed cannot have any maximum size set or a QUEUE-\/\+ERROR will be thrown \\
\hline
{\em arg} & an argument that will be included in each event hash in the {\itshape arg} key \\
\hline
{\em with\+\_\+data} & if \doxysectlink{basic_data_types_True}{True}{2}, then the actual raw data transferred / received is also included in the events\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em QUEUE-\/\+ERROR} & the Queue passed has a maximum size set\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{event_handling}{I/O Event Handling} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{for} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{more} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{information}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 added the {\itshape arg} and {\itshape with\+\_\+data} options 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ada4d53ed63a5df3ec798153a3caf65d1}\label{class_qore_1_1_socket_ada4d53ed63a5df3ec798153a3caf65d1} 
\index{Qore::Socket@{Qore::Socket}!setNoDelay@{setNoDelay}}
\index{setNoDelay@{setNoDelay}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setNoDelay()}{setNoDelay()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::set\+No\+Delay (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}}}]{nd = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Sets the boolean {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket. 

When this setting is \doxysectlink{basic_data_types_True}{True}{2}, then data will be immediately sent out over the socket, when it is \doxysectlink{basic_data_types_False}{False}{2}, then data transmission may be delayed to be packaged with other data for the same target.

Delayed data transmissions may cause problems when the sender immediately closes the socket after sending data; in this case the receiver may not get the data even though the send succeeded.

Note that if no value is given to the method, the argument will be assumed to be \doxysectlink{basic_data_types_True}{True}{2}, and output buffering will be turned off for the socket.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.setNoDelay(\textcolor{keyword}{True}))}
\DoxyCodeLine{\ \ \ \ printf(\textcolor{stringliteral}{"{}error\ setting\ TCP\_NODELAY:\ \%s\(\backslash\)n"{}},\ strerror(errno()));}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em nd} & the boolean {\ttfamily TCP\+\_\+\+NODELAY} setting for the socket\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 for success, non-\/zero for errors; to get error information, see \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} and \doxylink{group__library__functions_gadfdbab96958d3623d431a7ab292d7e27}{strerror()}
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a3cbc1223bd9cba7d58052febd5e92dab}{Socket\+::get\+No\+Delay()} 
\end{DoxySeeAlso}
\Hypertarget{class_qore_1_1_socket_aa7a28fc5c83ff2be97010d8ae2f48389}\label{class_qore_1_1_socket_aa7a28fc5c83ff2be97010d8ae2f48389} 
\index{Qore::Socket@{Qore::Socket}!setPrivateKey@{setPrivateKey}}
\index{setPrivateKey@{setPrivateKey}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setPrivateKey()}{setPrivateKey()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Private\+Key (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{key\+\_\+der }\end{DoxyParamCaption})}



Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate from a DER-\/encoded binary object representing the private key. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setPrivateKey(key\_der);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key\+\_\+der} & the DER-\/encoded binary object representing the private key for the X.\+509 certificate to use when establishing TLS/\+SSL encrypted connections \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_af7ae2ef7cc4202e68f356deda71369e9}\label{class_qore_1_1_socket_af7ae2ef7cc4202e68f356deda71369e9} 
\index{Qore::Socket@{Qore::Socket}!setPrivateKey@{setPrivateKey}}
\index{setPrivateKey@{setPrivateKey}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setPrivateKey()}{setPrivateKey()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Private\+Key (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_s_s_l_private_key}{SSLPrivate\+Key}}}]{key }\end{DoxyParamCaption})}



Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setPrivateKey(key);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key} & the private key for the X.\+509 certificate to use when establishing TLS/\+SSL encrypted connections \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_a82fa4152827ee55c14e3e8ef5b7fbbbc}\label{class_qore_1_1_socket_a82fa4152827ee55c14e3e8ef5b7fbbbc} 
\index{Qore::Socket@{Qore::Socket}!setPrivateKey@{setPrivateKey}}
\index{setPrivateKey@{setPrivateKey}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setPrivateKey()}{setPrivateKey()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Private\+Key (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key\+\_\+pem,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{pass }\end{DoxyParamCaption})}



Sets the private key to use for negotiating encrypted connections along with the X.\+509 certificate from a PEM-\/encoded string representing the private key and an optional password. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setPrivateKey(key\_pem,\ password);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key\+\_\+pem} & the PEM-\/encoded string representing the private key for the X.\+509 certificate to use when establishing TLS/\+SSL encrypted connections \\
\hline
{\em pass} & the password for the private key, if needed \\
\hline
\end{DoxyParams}
\Hypertarget{class_qore_1_1_socket_a314c17ae30d7e1b0cea515e6519734b1}\label{class_qore_1_1_socket_a314c17ae30d7e1b0cea515e6519734b1} 
\index{Qore::Socket@{Qore::Socket}!setRecvTimeout@{setRecvTimeout}}
\index{setRecvTimeout@{setRecvTimeout}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setRecvTimeout()}{setRecvTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::set\+Recv\+Timeout (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms }\end{DoxyParamCaption})}



sets the receive timeout as a socket option 

Returns 0 for success, -\/1 for error (check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the actual error in this case)

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.setRecvTimeout(20s))}
\DoxyCodeLine{\ \ \ \ printf(\textcolor{stringliteral}{"{}error\ setting\ timeout\ on\ socket:\ \%s\(\backslash\)n"{}},\ strerror(errno()));}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the receive timeout to set with a resolution of milliseconds; Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 for success, -\/1 for error (check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the actual error in this case) 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_aa88886547e8d064bee7c2e16f266c42c}\label{class_qore_1_1_socket_aa88886547e8d064bee7c2e16f266c42c} 
\index{Qore::Socket@{Qore::Socket}!setSendTimeout@{setSendTimeout}}
\index{setSendTimeout@{setSendTimeout}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setSendTimeout()}{setSendTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::set\+Send\+Timeout (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms }\end{DoxyParamCaption})}



sets the send timeout as a socket option 

Returns 0 for success, -\/1 for error (check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the actual error in this case)

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.setSendTimeout(20s))}
\DoxyCodeLine{\ \ \ \ printf(\textcolor{stringliteral}{"{}error\ setting\ timeout\ on\ socket:\ \%s\(\backslash\)n"{}},\ strerror(errno()));}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the send timeout to set with a resolution of milliseconds\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 for success, -\/1 for error (check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the actual error in this case) 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac}\label{class_qore_1_1_socket_aaafb6b597a1e5b3372d88ea53ea4cbac} 
\index{Qore::Socket@{Qore::Socket}!setSslVerifyMode@{setSslVerifyMode}}
\index{setSslVerifyMode@{setSslVerifyMode}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setSslVerifyMode()}{setSslVerifyMode()}}
{\footnotesize\ttfamily Qore\+::\+Socket\+::set\+Ssl\+Verify\+Mode (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{mode }\end{DoxyParamCaption})}



sets the SSL verification mode 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setSslVerifyMode(SSL\_VERIFY\_PEER|SSL\_VERIFY\_FAIL\_IF\_NO\_PEER\_CERT);}

\end{DoxyCode}

\end{DoxyParagraph}
If there is no SSL connection in place, then the mode is saved and will be used automatically for future SSL sessions automatically.


\begin{DoxyParams}{Parameters}
{\em mode} & the SSL verfication mode, see \doxylink{group__ssl__mode__constants}{SSL Verification Mode Constants} for more information\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_socket_a1338b37101ef0b82a6dde62b5369f5b9}{Socket\+::get\+Accept\+All\+Certificates()}
\item \doxylink{class_qore_1_1_socket_a749e2b7f8882b0e6fcc058886134daf5}{Socket\+::get\+Ssl\+Verify\+Mode()}
\item \doxylink{class_qore_1_1_socket_aa530d889c522a410e7e5e5163204d1db}{Socket\+::accept\+All\+Certificates()}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}\label{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a} 
\index{Qore::Socket@{Qore::Socket}!setWarningQueue@{setWarningQueue}}
\index{setWarningQueue@{setWarningQueue}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{setWarningQueue()}{setWarningQueue()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::set\+Warning\+Queue (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+ms,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+bs,  }\item[{Queue}]{queue,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}}}]{arg,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{min\+\_\+ms = {\ttfamily 1\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{s}}} }\end{DoxyParamCaption})}



Sets a \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive socket warnings. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.setWarningQueue(5000,\ 5000,\ queue,\ \textcolor{stringliteral}{"{}socket-\/1"{}});}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em warning\+\_\+ms} & the threshold in milliseconds for individual socket actions (send, receive, connect), if exceeded, a socket warning is placed on the warning queue with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}type"{}}\+: a string with the constant value {\ttfamily "{}\+SOCKET-\/\+OPERATION-\/\+WARNING"{}} 
\item {\ttfamily "{}operation"{}}\+: a string giving the operation that caused the warning (ex\+: {\ttfamily "{}connect"{}})
\item {\ttfamily "{}us"{}}\+: an integer giving the number of microseconds for the operation
\item {\ttfamily "{}timeout"{}}\+: an integer giving the warning threshold in microseconds
\item {\ttfamily "{}arg"{}}\+: if any {\ttfamily "{}arg"{}} argument is passed to the \doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()} method, it will be included in the warning hash here 
\end{DoxyItemize}\\
\hline
{\em warning\+\_\+bs} & value in bytes per second; if any call has performance below this threshold, a socket warning is placed on the warning queue with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}type"{}}\+: a string with the constant value {\ttfamily "{}\+SOCKET-\/\+THROUGHPUT-\/\+WARNING"{}} 
\item {\ttfamily "{}dir"{}}\+: either {\ttfamily "{}send"{}} or {\ttfamily "{}recv"{}} depending on the direction of the data flow
\item {\ttfamily "{}bytes"{}}\+: the amount of bytes sent
\item {\ttfamily "{}us"{}}\+: an integer giving the number of microseconds for the operation
\item {\ttfamily "{}bytes\+\_\+sec"{}}\+: a float giving the transfer speed in bytes per second
\item {\ttfamily "{}threshold"{}}\+: an integer giving the warning threshold in bytes per second
\item {\ttfamily "{}arg"{}}\+: if any {\ttfamily "{}arg"{}} argument is passed to the \doxylink{class_qore_1_1_socket_a4c3b78b845de5f48434e527755dec18a}{Socket\+::set\+Warning\+Queue()} method, it will be included in the warning hash here 
\end{DoxyItemize}\\
\hline
{\em queue} & the \doxylink{class_qore_1_1_thread_1_1_queue}{Queue} object to receive warning events \\
\hline
{\em arg} & an optional argument to be placed in the {\ttfamily "{}arg"{}} key in each warning hash (could be used to identify the socket for example) \\
\hline
{\em min\+\_\+ms} & the minimum transfer time with a resolution of milliseconds for a transfer to be eligible for triggering a warning; transfers that take less than this period of time are not eligible for raising a warning\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em QUEUE-\/\+ERROR} & the Queue passed has a maximum size set \\
\hline
{\em SOCKET-\/\+SETWARNINGQUEUE-\/\+ERROR} & at least one of {\itshape warning\+\_\+ms} and {\itshape warning\+\_\+bs} must be \texorpdfstring{$>$}{>} 0\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_socket_a9879dc24c43dbc9784386e36f1c2425b}{Socket\+::clear\+Warning\+Queue()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+9
\item Qore 0.\+8.\+12 the minimum threshold for a warning is a transfer of at least 1024 bytes, smaller transfers will not result in a warning 
\end{DoxyItemize}
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aab67c1ece890cdf79359ba56f1cd2731}\label{class_qore_1_1_socket_aab67c1ece890cdf79359ba56f1cd2731} 
\index{Qore::Socket@{Qore::Socket}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{shutdown()}{shutdown()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Socket\+::shutdown (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Ensures that a socket will be closed even if the file descriptor is shared with other processes (for example, after a call to \doxylink{group__library__functions_ga38309c0ab1c849afc031dd8547b1ac65}{fork()}) 

Does not throw any exceptions; returns an error code in case of an error

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (sock.shutdown())}
\DoxyCodeLine{\ \ \ \ stderr.printf(\textcolor{stringliteral}{"{}Error\ calling\ Socket::shutdown():\ \%s\(\backslash\)n"{}},\ strerror(errno()));}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
0 for success, -\/1 for error; in this case check \doxylink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()} for the error number 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_socket_ab2d2bda62f69f0d6da4fb6907a549562}\label{class_qore_1_1_socket_ab2d2bda62f69f0d6da4fb6907a549562} 
\index{Qore::Socket@{Qore::Socket}!shutdownSSL@{shutdownSSL}}
\index{shutdownSSL@{shutdownSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{shutdownSSL()}{shutdownSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::shutdown\+SSL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Shuts down the SSL connection on a secure connection. 

If any errors occur, an exception is raised

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.shutdownSSL();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+SSL-\/\+ERROR} & an error occurred shutting down the TLS/\+SSL connection \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_socket_a1d17452b2ef1ecc9c3ca4a06b17e2f19}\label{class_qore_1_1_socket_a1d17452b2ef1ecc9c3ca4a06b17e2f19} 
\index{Qore::Socket@{Qore::Socket}!startPollAccept@{startPollAccept}}
\index{startPollAccept@{startPollAccept}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollAccept()}{startPollAccept()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Accept (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to accept a new connection. 

\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to accept a new connection connection; the \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} method returns the new \doxylink{class_qore_1_1_socket}{Socket} after a successful poll operation
\end{DoxyReturn}
An SSL connection is automatically negotiated with the new connection if the \doxylink{class_qore_1_1_socket}{Socket} has a certificate and private key configured.

\begin{DoxySince}{Since}
Qore 2.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a7625085604b489d486a0d4f4b6041a51}\label{class_qore_1_1_socket_a7625085604b489d486a0d4f4b6041a51} 
\index{Qore::Socket@{Qore::Socket}!startPollConnect@{startPollConnect}}
\index{startPollConnect@{startPollConnect}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollConnect()}{startPollConnect()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Connect (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{target }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for a standard connection. 


\begin{DoxyParams}{Parameters}
{\em target} & the URL target\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for a standard connection
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a2b3b316ddfb1a70a75b851c6f26a3e84}\label{class_qore_1_1_socket_a2b3b316ddfb1a70a75b851c6f26a3e84} 
\index{Qore::Socket@{Qore::Socket}!startPollConnectSsl@{startPollConnectSsl}}
\index{startPollConnectSsl@{startPollConnectSsl}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollConnectSsl()}{startPollConnectSsl()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Connect\+Ssl (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{target }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for an SSL connection. 


\begin{DoxyParams}{Parameters}
{\em target} & the URL target\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to poll the socket for an SSL connection
\end{DoxyReturn}
The poll operation returned will perform the connection and an immediate upgrade to an SSL/\+TLS connection

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_adf42019305419e0a2648a3172d055108}\label{class_qore_1_1_socket_adf42019305419e0a2648a3172d055108} 
\index{Qore::Socket@{Qore::Socket}!startPollReadHttpHeader@{startPollReadHttpHeader}}
\index{startPollReadHttpHeader@{startPollReadHttpHeader}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollReadHttpHeader()}{startPollReadHttpHeader()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Read\+Http\+Header (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read an HTTP header without blocking. 

\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read an HTTP header without blocking
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a hash with the following keys after a successful poll for inbound socket data\+:
\begin{DoxyItemize}
\item hdr\+: a hash of header info like that returned from \doxylink{class_qore_1_1_socket_aceccb23bcbdb7dfab858076402ba98a9}{read\+HTTPHeader()}\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} a string giving the HTTP version set in the header
\item {\ttfamily status\+\_\+code\+:} (HTTP responses only) an integer giving the status code
\item {\ttfamily status\+\_\+message\+:} (HTTP responses only) if present in an HTTP response, this key will be set to the message after the status code
\item {\ttfamily method\+:} (HTTP requests only) a string giving the HTTP method (i.\+e. {\ttfamily "{}\+GET"{}}, {\ttfamily "{}\+POST"{}}, etc)
\item {\ttfamily path\+:} (HTTP requests only) a string giving the path in a request without any decoding; use \doxylink{group__misc__functions_ga2f5349505d3d2563ef31f4d8b5c5f1b3}{decode\+\_\+url()} to decode if necessary
\end{DoxyItemize}
\item info\+: a hash of other information\+:
\begin{DoxyItemize}
\item {\ttfamily headers-\/raw}\+: the raw headers read without any case conversions or other processing
\item {\ttfamily request-\/uri}\+: (only set when parsing a request header) gives the request URI in an HTTP request
\item {\ttfamily response-\/uri}\+: (only set when parsing a response header) gives the response URI in an HTTP response
\item {\ttfamily body-\/content-\/type}\+: this is the {\ttfamily "{}\+Content-\/\+Type"{}} header without any charset declaration
\item {\ttfamily charset\+:} if there is a charset declaration in the {\ttfamily "{}\+Content-\/\+Type"{}} header, the value is returned in this key
\item {\ttfamily close\+:} (only set when parsing a request header) set to \doxysectlink{basic_data_types_True}{True}{2} if the connection should be closed after responding, \doxysectlink{basic_data_types_False}{False}{2} if not; see notes below about how this value is calculated
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily "{}\+Accept-\/\+Charset"{}} header; if any of {\ttfamily "{}\texorpdfstring{$\ast$}{*}"{}}, {\ttfamily "{}utf8"{}}, or {\ttfamily "{}utf-\/8"{}} are present, then this will be set to {\ttfamily "{}utf8"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily accept-\/encoding}\+: this key will be set to a list of values from any {\ttfamily "{}\+Accept-\/\+Encoding"{}} header
\end{DoxyItemize}
\end{DoxyItemize}

\begin{DoxySince}{Since}
Qore 2.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a412684112cb6ae24b0034e3f1688893a}\label{class_qore_1_1_socket_a412684112cb6ae24b0034e3f1688893a} 
\index{Qore::Socket@{Qore::Socket}!startPollRecvBinary@{startPollRecvBinary}}
\index{startPollRecvBinary@{startPollRecvBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollRecvBinary()}{startPollRecvBinary()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Recv\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{size }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em size} & the size of the string to receive\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a binary object after a successful poll for inbound socket data

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_af7d76d0129b493c5c104970ab7e6aac5}\label{class_qore_1_1_socket_af7d76d0129b493c5c104970ab7e6aac5} 
\index{Qore::Socket@{Qore::Socket}!startPollRecvData@{startPollRecvData}}
\index{startPollRecvData@{startPollRecvData}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollRecvData()}{startPollRecvData()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Recv\+Data (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object for receiving data in non-\/blocking mode. 

\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode; data will be read until the connection would block or at most 640KB of data has been read
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a binary object after a successful poll for inbound socket data; whatever data can be read will be returned

\begin{DoxySince}{Since}
Qore 2.\+0 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aa5c1b3f7285d859333fcf9341412f6b6}\label{class_qore_1_1_socket_aa5c1b3f7285d859333fcf9341412f6b6} 
\index{Qore::Socket@{Qore::Socket}!startPollRecvString@{startPollRecvString}}
\index{startPollRecvString@{startPollRecvString}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollRecvString()}{startPollRecvString()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Recv\+String (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{size }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em size} & the size of the string to receive\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a string after a successful poll for inbound socket data

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ab5d2a9a08f8e4927646bcc214ec7344e}\label{class_qore_1_1_socket_ab5d2a9a08f8e4927646bcc214ec7344e} 
\index{Qore::Socket@{Qore::Socket}!startPollRecvUntilBytesBinary@{startPollRecvUntilBytesBinary}}
\index{startPollRecvUntilBytesBinary@{startPollRecvUntilBytesBinary}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollRecvUntilBytesBinary()}{startPollRecvUntilBytesBinary()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Recv\+Until\+Bytes\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{pattern }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em pattern} & the pattern to use to signify the end of the socket data to read\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a binary object after a successful poll for inbound socket data

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a857e24f03cdb6c88b5cd56030aaf9a53}\label{class_qore_1_1_socket_a857e24f03cdb6c88b5cd56030aaf9a53} 
\index{Qore::Socket@{Qore::Socket}!startPollRecvUntilBytesString@{startPollRecvUntilBytesString}}
\index{startPollRecvUntilBytesString@{startPollRecvUntilBytesString}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollRecvUntilBytesString()}{startPollRecvUntilBytesString()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Recv\+Until\+Bytes\+String (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{pattern }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em pattern} & the pattern to use to signify the end of the socket data to read\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to read data in non-\/blocking mode
\end{DoxyReturn}
The \doxylink{class_qore_1_1_abstract_poll_operation_a55581ca43fbdd2a647dc3bf94ed38766}{Abstract\+Poll\+Operation\+::get\+Output()} call will return a string after a successful poll for inbound socket data

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a9053ac6a07bb482ef0bc8bdb9368d6e6}\label{class_qore_1_1_socket_a9053ac6a07bb482ef0bc8bdb9368d6e6} 
\index{Qore::Socket@{Qore::Socket}!startPollSend@{startPollSend}}
\index{startPollSend@{startPollSend}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollSend()}{startPollSend()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{data }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em data} & the data to send\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ab9c5faba4df243b31ed97d3771a7f818}\label{class_qore_1_1_socket_ab9c5faba4df243b31ed97d3771a7f818} 
\index{Qore::Socket@{Qore::Socket}!startPollSend@{startPollSend}}
\index{startPollSend@{startPollSend}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollSend()}{startPollSend()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{data }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode. 


\begin{DoxyParams}{Parameters}
{\em data} & the data to send\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to send data in non-\/blocking mode
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a66708f1d0cc7ba38051884e4b19b0351}\label{class_qore_1_1_socket_a66708f1d0cc7ba38051884e4b19b0351} 
\index{Qore::Socket@{Qore::Socket}!startPollUpgradeClientToSSL@{startPollUpgradeClientToSSL}}
\index{startPollUpgradeClientToSSL@{startPollUpgradeClientToSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollUpgradeClientToSSL()}{startPollUpgradeClientToSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Upgrade\+Client\+To\+SSL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected client socket to SSL. 

\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected client socket to SSL
\end{DoxyReturn}
The poll operation returned will upgrade a client connection to an SSL/\+TLS connection using any certificate and private key set for the socket.

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_aaafb534070e81b96e251c643684806e7}\label{class_qore_1_1_socket_aaafb534070e81b96e251c643684806e7} 
\index{Qore::Socket@{Qore::Socket}!startPollUpgradeServerToSSL@{startPollUpgradeServerToSSL}}
\index{startPollUpgradeServerToSSL@{startPollUpgradeServerToSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{startPollUpgradeServerToSSL()}{startPollUpgradeServerToSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation}} Qore\+::\+Socket\+::start\+Poll\+Upgrade\+Server\+To\+SSL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected server socket to SSL. 

\begin{DoxyReturn}{Returns}
an \doxylink{class_qore_1_1_abstract_poll_operation}{Abstract\+Poll\+Operation} object to upgrade a connected server socket to SSL
\end{DoxyReturn}
The poll operation returned will upgrade a server connection to an SSL/\+TLS connection using the certificate and private key set on the socket.

\begin{DoxySince}{Since}
Qore 1.\+12 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_ad471f7399655c3fb211c72b55ca568d9}\label{class_qore_1_1_socket_ad471f7399655c3fb211c72b55ca568d9} 
\index{Qore::Socket@{Qore::Socket}!upgradeClientToSSL@{upgradeClientToSSL}}
\index{upgradeClientToSSL@{upgradeClientToSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{upgradeClientToSSL()}{upgradeClientToSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::upgrade\+Client\+To\+SSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Upgrades a client socket connection to a TLS/\+SSL connection. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.upgradeClientToSSL();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & If a positive timeout value is passed and the SSL upgrade takes longer to establish than the timeout, an {\ttfamily "{}\+SSL-\/\+TIMEOUT-\/\+ERROR"{}} exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket must be open before making this call \\
\hline
{\em SSL-\/\+TIMEOUT-\/\+ERROR} & timeout error negotiating SSL connection\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
if an SSL connection has already been established, this method call returns immediately without taking any further action
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 the timeout\+\_\+ms parameter was added 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a83385d31d5b112409424269f025de5ea}\label{class_qore_1_1_socket_a83385d31d5b112409424269f025de5ea} 
\index{Qore::Socket@{Qore::Socket}!upgradeServerToSSL@{upgradeServerToSSL}}
\index{upgradeServerToSSL@{upgradeServerToSSL}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{upgradeServerToSSL()}{upgradeServerToSSL()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Socket\+::upgrade\+Server\+To\+SSL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{timeout}}}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Upgrades a server socket connection to a TLS/\+SSL connection. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{sock.upgradeServerToSSL();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & If a positive timeout value is passed and the SSL upgrade takes longer to establish than the timeout, an {\ttfamily "{}\+SSL-\/\+TIMEOUT-\/\+ERROR"{}} exception is thrown. Note that like all Qore functions and methods taking timeout values, a \doxysectlink{basic_data_types_relative_dates}{relative date/time value}{2} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.)\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em SOCKET-\/\+NOT-\/\+OPEN} & the socket must be open before making this call \\
\hline
{\em SSL-\/\+TIMEOUT-\/\+ERROR} & timeout error negotiating SSL connection\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
if an SSL connection has already been established, this method call returns immediately without taking any further action
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 the timeout\+\_\+ms parameter was added 
\end{DoxySince}
\Hypertarget{class_qore_1_1_socket_a601f1a0515d127d2cca2b4febdb40d31}\label{class_qore_1_1_socket_a601f1a0515d127d2cca2b4febdb40d31} 
\index{Qore::Socket@{Qore::Socket}!verifyPeerCertificate@{verifyPeerCertificate}}
\index{verifyPeerCertificate@{verifyPeerCertificate}!Qore::Socket@{Qore::Socket}}
\doxysubsubsection{\texorpdfstring{verifyPeerCertificate()}{verifyPeerCertificate()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Socket\+::verify\+Peer\+Certificate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns a string code giving the result of verifying the remote certificate or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if an encrypted connection is not currently established. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string\ str\ =\ sock.verifyPeerCertificate();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
A string code giving the result of verifying the peer\textquotesingle{}s certificate. No value is returned if a secure connection has not been established. The set of possible return values is made up of the keys of the \doxylink{group__x509__verification__constants_ga0ebd0784741e7d3521e972da7f294aba}{X509\+\_\+\+Verification\+Reasons} hash. This hash can also be used to generate a textual description of the verification result. 
\end{DoxyReturn}
