<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Framepp.html"> <link rel="next" href="Ocsigen_charset_mime.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Ocsigen_cache" rel="Chapter" href="Ocsigen_cache.html"> <link title="Ocsigen_lib_base" rel="Chapter" href="Ocsigen_lib_base.html"> <link title="Ocsigen_lib" rel="Chapter" href="Ocsigen_lib.html"> <link title="Ocsigen_config" rel="Chapter" href="Ocsigen_config.html"> <link title="Ocsigen_getcommandline" rel="Chapter" href="Ocsigen_getcommandline.html"> <link title="Ocsigen_messages" rel="Chapter" href="Ocsigen_messages.html"> <link title="Ocsigen_stream" rel="Chapter" href="Ocsigen_stream.html"> <link title="Ocsigen_loader" rel="Chapter" href="Ocsigen_loader.html"> <link title="Polytables" rel="Chapter" href="Polytables.html"> <link title="Http_headers" rel="Chapter" href="Http_headers.html"> <link title="Ocsigen_http_frame" rel="Chapter" href="Ocsigen_http_frame.html"> <link title="Ocsigen_headers" rel="Chapter" href="Ocsigen_headers.html"> <link title="Framepp" rel="Chapter" href="Framepp.html"> <link title="Ocsigen_http_com" rel="Chapter" href="Ocsigen_http_com.html"> <link title="Ocsigen_charset_mime" rel="Chapter" href="Ocsigen_charset_mime.html"> <link title="Ocsigen_senders" rel="Chapter" href="Ocsigen_senders.html"> <link title="Ocsigen_cookies" rel="Chapter" href="Ocsigen_cookies.html"> <link title="Ocsigen_extensions" rel="Chapter" href="Ocsigen_extensions.html"> <link title="Ocsigen_parseconfig" rel="Chapter" href="Ocsigen_parseconfig.html"> <link title="Ocsigen_http_client" rel="Chapter" href="Ocsigen_http_client.html"> <link title="Ocsigen_local_files" rel="Chapter" href="Ocsigen_local_files.html"> <link title="Ocsigen_server" rel="Chapter" href="Ocsigen_server.html"> <link title="Ocsigen_comet" rel="Chapter" href="Ocsigen_comet.html"> <link title="Accesscontrol" rel="Chapter" href="Accesscontrol.html"> <link title="Authbasic" rel="Chapter" href="Authbasic.html"> <link title="Ocsipersist" rel="Chapter" href="Ocsipersist.html"><title>Ocsigen_http_com</title> </head> <body> <div class="navbar"><a class="pre" href="Framepp.html" title="Framepp">Previous</a> <a class="up" href="index.html" title="Index">Up</a> <a class="post" href="Ocsigen_charset_mime.html" title="Ocsigen_charset_mime">Next</a> </div> <h1>Module <a href="type_Ocsigen_http_com.html">Ocsigen_http_com</a></h1> <pre><span class="keyword">module</span> Ocsigen_http_com: <code class="code">sig</code> <a href="Ocsigen_http_com.html">..</a> <code class="code">end</code></pre><div class="info module top"> Sending and receiving HTTP frames<br> </div> <hr width="100%"> <pre><span id="EXCEPTIONConnection_closed"><span class="keyword">exception</span> Connection_closed</span></pre> <div class="info "> The other side has cleanly closed the connection after a message<br> </div> <pre><span id="EXCEPTIONLost_connection"><span class="keyword">exception</span> Lost_connection</span> <span class="keyword">of</span> <code class="type">exn</code></pre> <div class="info "> The connection has been unexpectedly broken<br> </div> <pre><span id="EXCEPTIONTimeout"><span class="keyword">exception</span> Timeout</span></pre> <div class="info "> No activity on the other side<br> </div> <pre><span id="EXCEPTIONKeepalive_timeout"><span class="keyword">exception</span> Keepalive_timeout</span></pre> <pre><span id="EXCEPTIONAborted"><span class="keyword">exception</span> Aborted</span></pre> <div class="info "> Connection killed<br> </div> <pre><code><span id="TYPEmode"><span class="keyword">type</span> <code class="type"></code>mode</span> = </code></pre><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span id="TYPEELTmode.Answer"><span class="constructor">Answer</span></span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span id="TYPEELTmode.Query"><span class="constructor">Query</span></span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span id="TYPEELTmode.Nofirstline"><span class="constructor">Nofirstline</span></span></code></td> </tr></table> <pre><span id="TYPEconnection"><span class="keyword">type</span> <code class="type"></code>connection</span> </pre> <pre><span id="VALcreate_receiver"><span class="keyword">val</span> create_receiver</span> : <code class="type">int -> <a href="Ocsigen_http_com.html#TYPEmode">mode</a> -> Lwt_ssl.socket -> <a href="Ocsigen_http_com.html#TYPEconnection">connection</a></code></pre> <pre><span id="VALlock_receiver"><span class="keyword">val</span> lock_receiver</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit Lwt.t</code></pre> <pre><span id="VALunlock_receiver"><span class="keyword">val</span> unlock_receiver</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit</code></pre> <pre><span id="VALwakeup_next_request"><span class="keyword">val</span> wakeup_next_request</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit</code></pre> <pre><span id="VALblock_next_request"><span class="keyword">val</span> block_next_request</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit Lwt.t</code></pre> <pre><span id="VALget_http_frame"><span class="keyword">val</span> get_http_frame</span> : <code class="type">?head:bool -> <a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre> <pre><span id="VALconnection_id"><span class="keyword">val</span> connection_id</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> int</code></pre> <pre><span id="VALconnection_fd"><span class="keyword">val</span> connection_fd</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> Lwt_ssl.socket</code></pre> <pre><span id="VALclosed"><span class="keyword">val</span> closed</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit Lwt.t</code></pre><div class="info "> <code class="code">closed conn</code> is a thread waking up when the connection is closed<br> </div> <pre><span id="TYPEslot"><span class="keyword">type</span> <code class="type"></code>slot</span> </pre> <pre><span id="VALstart_processing"><span class="keyword">val</span> start_processing</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> (<a href="Ocsigen_http_com.html#TYPEslot">slot</a> -> unit Lwt.t) -> unit</code></pre> <pre><span id="VALwait_all_senders"><span class="keyword">val</span> wait_all_senders</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit Lwt.t</code></pre> <pre><span id="VALwrite_stream"><span class="keyword">val</span> write_stream</span> : <code class="type">?chunked:bool -><br> Lwt_chan.out_channel -> string <a href="Ocsigen_stream.html#TYPEt">Ocsigen_stream.t</a> -> unit Lwt.t</code></pre><div class="info "> This function may return any I/O error from the channel, or a interrupted stream exception.<br> </div> <pre><span id="TYPEsender_type"><span class="keyword">type</span> <code class="type"></code>sender_type</span> </pre> <pre><span id="VALcreate_sender"><span class="keyword">val</span> create_sender</span> : <code class="type">?server_name:string -><br> ?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br> ?proto:<a href="Ocsigen_http_frame.Http_header.html#TYPEproto">Ocsigen_http_frame.Http_header.proto</a> -><br> unit -> <a href="Ocsigen_http_com.html#TYPEsender_type">sender_type</a></code></pre> <pre><span id="VALdefault_sender"><span class="keyword">val</span> default_sender</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEsender_type">sender_type</a></code></pre><div class="info "> Sender with only the server name, and HTTP/1.1<br> </div> <pre><span id="VALsend"><span class="keyword">val</span> send</span> : <code class="type">?reopen:(unit -> unit Lwt.t) -><br> <a href="Ocsigen_http_com.html#TYPEslot">slot</a> -><br> clientproto:<a href="Ocsigen_http_frame.Http_header.html#TYPEproto">Ocsigen_http_frame.Http_header.proto</a> -><br> ?mode:<a href="Ocsigen_http_frame.Http_header.html#TYPEhttp_mode">Ocsigen_http_frame.Http_header.http_mode</a> -><br> ?proto:<a href="Ocsigen_http_frame.Http_header.html#TYPEproto">Ocsigen_http_frame.Http_header.proto</a> -><br> ?keep_alive:bool -><br> head:bool -><br> sender:<a href="Ocsigen_http_com.html#TYPEsender_type">sender_type</a> -><br> <a href="Ocsigen_http_frame.html#TYPEresult">Ocsigen_http_frame.result</a> -> unit Lwt.t</code></pre><div class="info "> send an HTTP message. <code class="code">send</code> may also fail with <code class="code">Interrupted_stream</code> exception if the input stream is interrupted.<br> </div> <pre><span id="VALabort"><span class="keyword">val</span> abort</span> : <code class="type"><a href="Ocsigen_http_com.html#TYPEconnection">connection</a> -> unit</code></pre> <pre><span id="VALset_result_observer"><span class="keyword">val</span> set_result_observer</span> : <code class="type">(<a href="Ocsigen_http_frame.Http_header.html#TYPEhttp_header">Ocsigen_http_frame.Http_header.http_header</a> -> string -> unit Lwt.t) -> unit</code></pre><div class="info "> Use this function to make an action just before sending the result (for example observe the headers that will be sent). The parameter is a function taking the set of headers twice, first as <code class="code">Ocsigen_http_frame.Http_headers.http_header</code>, second as a <code class="code">string</code>.<br> </div> </body></html>