/usr/share/doc/racket/web-server-internal/dispatch-server-unit.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>1 Dispatching Server</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Web Server:<span class="mywbr"> </span> HTTP Server</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Dispatching Server</a></td></tr><tr><td align="right">2 </td><td><a href="dispatchers.html" class="tocviewlink" data-pltdoc="x">Dispatchers</a></td></tr><tr><td align="right">3 </td><td><a href="web-server.html" class="tocviewlink" data-pltdoc="x">Launching Servers</a></td></tr><tr><td align="right">4 </td><td><a href="Web_Servers.html" class="tocviewlink" data-pltdoc="x">Web Servers</a></td></tr><tr><td align="right">5 </td><td><a href="private.html" class="tocviewlink" data-pltdoc="x">Internal APIs</a></td></tr><tr><td align="right">6 </td><td><a href="Troubleshooting_and_Tips.html" class="tocviewlink" data-pltdoc="x">Troubleshooting and Tips</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Dispatching Server</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.1 </td><td><a href="#%28part._.Dispatching_.Server_.Signatures%29" class="tocviewlink" data-pltdoc="x">Dispatching Server Signatures</a></td></tr><tr><td align="right">1.2 </td><td><a href="#%28part._.Dispatching_.Server_.Unit%29" class="tocviewlink" data-pltdoc="x">Dispatching Server Unit</a></td></tr><tr><td align="right">1.3 </td><td><a href="#%28part._.Threads_and_.Custodians%29" class="tocviewlink" data-pltdoc="x">Threads and Custodians</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">1.1<tt> </tt></span><a href="#%28part._.Dispatching_.Server_.Signatures%29" class="tocsubseclink" data-pltdoc="x">Dispatching Server Signatures</a></td></tr><tr><td><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">dispatch-<wbr></wbr>server^</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e._serve%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">serve</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e._serve-ports%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">serve-<wbr></wbr>ports</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">dispatch-<wbr></wbr>server-<wbr></wbr>config^</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._port%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">port</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._listen-ip%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">listen-<wbr></wbr>ip</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._max-waiting%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">max-<wbr></wbr>waiting</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._initial-connection-timeout%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">initial-<wbr></wbr>connection-<wbr></wbr>timeout</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._read-request%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>request</span></span></a></td></tr><tr><td><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._dispatch%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dispatch</span></span></a></td></tr><tr><td><span class="tocsublinknumber">1.2<tt> </tt></span><a href="#%28part._.Dispatching_.Server_.Unit%29" class="tocsubseclink" data-pltdoc="x">Dispatching Server Unit</a></td></tr><tr><td><a href="#%28def._%28%28lib._web-server%2Fprivate%2Fdispatch-server-unit..rkt%29._dispatch-server~40%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dispatch-<wbr></wbr>server@</span></span></a></td></tr><tr><td><span class="tocsublinknumber">1.3<tt> </tt></span><a href="#%28part._.Threads_and_.Custodians%29" class="tocsubseclink" data-pltdoc="x">Threads and Custodians</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="index.html" title="backward to "Web Server: HTTP Server"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Web Server: HTTP Server"" data-pltdoc="x">up</a> <a href="dispatchers.html" title="forward to "2 Dispatchers"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "web-server/scribblings/web-server-internal.scrbl")" x-part-tag=""dispatch-server-unit"">1<tt> </tt><a name="(part._dispatch-server-unit)"></a>Dispatching Server</h3><p>The Web Server is just a configuration of a dispatching server.</p><h4 x-source-module="(lib "web-server/scribblings/web-server-internal.scrbl")" x-part-tag=""Dispatching_Server_Signatures"">1.1<tt> </tt><a name="(part._.Dispatching_.Server_.Signatures)"></a><a name="(mod-path._web-server/private/dispatch-server-sig)"></a>Dispatching Server Signatures</h4><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left" colspan="2"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._web-server%2Fprivate%2Fdispatch-server-sig%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">web-server/private/dispatch-server-sig</span></a><span class="RktPn">)</span></td></tr><tr><td align="left"> </td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">web-server-lib</span></span></td></tr></table></div><div class="SIntrapara">The <a href="#%28mod-path._web-server%2Fprivate%2Fdispatch-server-sig%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">web-server/private/dispatch-server-sig</span></a> library
provides two signatures.</div><div class="SIntrapara"><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>signature</p></div></div><p class="RForeground"><a name="(form._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server~5e))"></a><span title="Provided from: web-server/private/dispatch-server-sig | Package: web-server-lib"><span class="RktSym"><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">dispatch-server^</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span>signature</p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="leftindent"><p>The <span class="RktSym"><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e%29%29" class="RktStxLink" data-pltdoc="x">dispatch-server^</a></span> signature is an alias for
<span class="RktSym"><a href="Web_Servers.html#%28form._%28%28lib._web-server%2Fweb-server-sig..rkt%29._web-server~5e%29%29" class="RktStxLink" data-pltdoc="x">web-server^</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server~5e._serve))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e._serve%29%29" class="RktValDef RktValLink" data-pltdoc="x">serve</a></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%252A%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">#:confirmation-channel</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=async-channel.html%23%2528def._%2528%2528lib._racket%252Fasync-channel..rkt%2529._async-channel%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">async-channel?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Runs the server—<wbr></wbr>the confirmation channel will be send an exception if one occurs starting the server or the port number if there is none—<wbr></wbr>and returns a procedure that shuts down the server.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server~5e._serve-ports))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e._serve-ports%29%29" class="RktValDef RktValLink" data-pltdoc="x">serve-ports</a></span><span class="hspace"> </span><span class="RktVar">ip</span><span class="hspace"> </span><span class="RktVar">op</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">ip</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">op</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Serves a single connection represented by the ports <span class="RktVar">ip</span> and
<span class="RktVar">op</span>.</div></p></blockquote></div></p></div><div class="SIntrapara"><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>signature</p></div></div><p class="RForeground"><a name="(form._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e))"></a><span title="Provided from: web-server/private/dispatch-server-sig | Package: web-server-lib"><span class="RktSym"><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">dispatch-server-config^</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span>signature</p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="leftindent"><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._port))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._port%29%29" class="RktValDef RktValLink" data-pltdoc="x">port</a></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=unstable&rel=contract.html%23%2528def._%2528%2528lib._unstable%252Fcontract..rkt%2529._tcp-listen-port%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">tcp-listen-port?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Specifies the port to serve on.
</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._listen-ip))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._listen-ip%29%29" class="RktValDef RktValLink" data-pltdoc="x">listen-ip</a></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Passed to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=tcp.html%23%2528def._%2528%2528lib._racket%252Ftcp..rkt%2529._tcp-listen%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">tcp-listen</a></span>.
</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._max-waiting))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._max-waiting%29%29" class="RktValDef RktValLink" data-pltdoc="x">max-waiting</a></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Passed to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=tcp.html%23%2528def._%2528%2528lib._racket%252Ftcp..rkt%2529._tcp-listen%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">tcp-listen</a></span>.
</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._initial-connection-timeout))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._initial-connection-timeout%29%29" class="RktValDef RktValLink" data-pltdoc="x">initial-connection-timeout</a></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._integer%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">integer?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Specifies the initial timeout given to a connection.
</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._read-request))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._read-request%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-request</a></span><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">port-addresses</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0"><tr><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></td></tr></table></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="connection-manager.html#%28def._%28%28lib._web-server%2Fprivate%2Fconnection-manager..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=unstable&rel=contract.html%23%2528def._%2528%2528lib._unstable%252Fcontract..rkt%2529._tcp-listen-port%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">tcp-listen-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">port-addresses</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._input-port%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">input-port?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=values.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._values%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">values</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Defines the way the server reads requests off connections to be passed
to <span class="RktSym">dispatch</span>.
</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(sig-val._((lib._web-server/private/dispatch-server-sig..rkt)._dispatch-server-config~5e._dispatch))"></a><span class="RktSym"><a href="#%28sig-val._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e._dispatch%29%29" class="RktValDef RktValLink" data-pltdoc="x">dispatch</a></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="connection-manager.html#%28def._%28%28lib._web-server%2Fprivate%2Fconnection-manager..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">How to handle requests.</div></p></blockquote></div></p></div></p><h4 x-source-module="(lib "web-server/scribblings/web-server-internal.scrbl")" x-part-tag=""Dispatching_Server_Unit"">1.2<tt> </tt><a name="(part._.Dispatching_.Server_.Unit)"></a><a name="(mod-path._web-server/private/dispatch-server-unit)"></a>Dispatching Server Unit</h4><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left" colspan="2"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._web-server%2Fprivate%2Fdispatch-server-unit%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">web-server/private/dispatch-server-unit</span></a><span class="RktPn">)</span></td></tr><tr><td align="left"> </td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">web-server-lib</span></span></td></tr></table></div><div class="SIntrapara">The <a href="#%28mod-path._web-server%2Fprivate%2Fdispatch-server-unit%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">web-server/private/dispatch-server-unit</span></a> module
provides the unit that actually implements a dispatching server.</div><div class="SIntrapara"><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><table cellspacing="0" cellpadding="0" class="argcontract RForeground"><tr><td><a name="(def._((lib._web-server/private/dispatch-server-unit..rkt)._dispatch-server~40))"></a><span title="Provided from: web-server/private/dispatch-server-unit | Package: web-server-lib"><span class="RktSym"><a href="#%28def._%28%28lib._web-server%2Fprivate%2Fdispatch-server-unit..rkt%29._dispatch-server~40%29%29" class="RktValDef RktValLink" data-pltdoc="x">dispatch-server@</a></span></span></td><td><span class="hspace"> </span>:<span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=unitcontracts.html%23%2528form._%2528%2528lib._racket%252Funit..rkt%2529._unit%252Fc%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">unit/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=creatingunits.html%23%2528form._%2528%2528lib._racket%252Funit..rkt%2529._import%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">import</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=net&rel=tcp.html%23%2528form._%2528%2528lib._net%252Ftcp-sig..rkt%2529._tcp%7E5e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">tcp^</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server-config~5e%29%29" class="RktStxLink" data-pltdoc="x">dispatch-server-config^</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=creatingunits.html%23%2528form._%2528%2528lib._racket%252Funit..rkt%2529._export%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">export</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28form._%28%28lib._web-server%2Fprivate%2Fdispatch-server-sig..rkt%29._dispatch-server~5e%29%29" class="RktStxLink" data-pltdoc="x">dispatch-server^</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Runs the dispatching server config in a very basic way, except that it uses
<a href="connection-manager.html" data-pltdoc="x">Connection Manager</a> to manage connections.</div></p></div></p><h4 x-source-module="(lib "web-server/scribblings/web-server-internal.scrbl")" x-part-tag=""Threads_and_Custodians"">1.3<tt> </tt><a name="(part._.Threads_and_.Custodians)"></a>Threads and Custodians</h4><p>The dispatching server runs in a dedicated thread. Every time a connection is initiated, a new thread is started to handle it.
Connection threads are created inside a dedicated custodian that is a child of the server’s custodian. When the server is used to
provide servlets, each servlet also receives a new custodian that is a child of the server’s custodian <span style="font-weight: bold">not</span> the connection
custodian.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="index.html" title="backward to "Web Server: HTTP Server"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Web Server: HTTP Server"" data-pltdoc="x">up</a> <a href="dispatchers.html" title="forward to "2 Dispatchers"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|