You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

124 lines
13 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webserv: includes/Master.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Webserv
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_09e761304027c904456130627fd4dcf5.html">includes</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Master.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="Master_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#include &quot;<a class="code" href="webserv_8hpp.html">webserv.hpp</a>&quot;</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"><a class="line" href="classMaster.html"> 4</a></span><span class="keyword">class </span><a class="code hl_class" href="classMaster.html">Master</a> {</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"><a class="line" href="classMaster.html#aee2fccb9a95dd83c89049c86a86ff5f3"> 5</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classMaster.html#aee2fccb9a95dd83c89049c86a86ff5f3">_fd</a>;</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"><a class="line" href="classMaster.html#af4afc9ab34343b13939139087e280472"> 6</a></span> std::vector&lt;Client *&gt; <a class="code hl_variable" href="classMaster.html#af4afc9ab34343b13939139087e280472">_childs</a>;</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="classMaster.html#a2930920309de02e86050a8facdc83b68"> 7</a></span> <span class="keyword">struct </span>sockaddr_in <a class="code hl_variable" href="classMaster.html#a2930920309de02e86050a8facdc83b68">_address</a>;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> <a class="code hl_class" href="classMaster.html">Master</a>(<a class="code hl_struct" href="structip__port__s.html">ip_port_t</a> listen);</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="classMaster.html#af169284c429812878d318cd2fb009254"> 11</a></span> <a class="code hl_function" href="classMaster.html#af169284c429812878d318cd2fb009254">Master</a>(<span class="keywordtype">int</span> fd, <a class="code hl_class" href="classMaster.html">Master</a> *parent);</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <a class="code hl_function" href="classMaster.html#aa76c335c36c93e8134115733938651df">~Master</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classMaster.html#aa129a09fad260366b16aa04a7de173c2">pre_select</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classMaster.html#a3ffb0ce7702a04ab7a9ec5dfa1ff6e42">post_select</a>(<a class="code hl_class" href="classEnv.html">Env</a> *env);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_class" href="classServer.html">Server</a> *<a class="code hl_function" href="classMaster.html#a5486cb0d32ba29cd31b212c3457942b1">choose_server</a>(<a class="code hl_class" href="classEnv.html">Env</a> *env, <span class="keywordtype">string</span> host);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="classMaster.html#af5432a935125075c1eb03aa9e8c8f894"> 18</a></span> <a class="code hl_struct" href="structip__port__s.html">ip_port_t</a> <a class="code hl_variable" href="classMaster.html#af5432a935125075c1eb03aa9e8c8f894">_listen</a>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="classMaster.html#a16a05173b1961ea7fc302319f06716a4"> 19</a></span> <span class="keyword">static</span> fd_set <a class="code hl_variable" href="classMaster.html#a16a05173b1961ea7fc302319f06716a4">_readfds</a>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classMaster.html#a2418abd3c0d0e9f4db769335cadd7545"> 20</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classMaster.html#a40b24ae083809951e7d3e1a08d06fe65">_max_fd</a>, <a class="code hl_variable" href="classMaster.html#a6c0dd4e4c7de17dea3de77f28e1de308">_min_fd</a>, <a class="code hl_variable" href="classMaster.html#a2418abd3c0d0e9f4db769335cadd7545">_amount</a>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>};</div>
<div class="ttc" id="aclassEnv_html"><div class="ttname"><a href="classEnv.html">Env</a></div><div class="ttdef"><b>Definition:</b> <a href="Env_8hpp_source.html#l00004">Env.hpp:4</a></div></div>
<div class="ttc" id="aclassMaster_html"><div class="ttname"><a href="classMaster.html">Master</a></div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00004">Master.hpp:4</a></div></div>
<div class="ttc" id="aclassMaster_html_a16a05173b1961ea7fc302319f06716a4"><div class="ttname"><a href="classMaster.html#a16a05173b1961ea7fc302319f06716a4">Master::_readfds</a></div><div class="ttdeci">static fd_set _readfds</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00019">Master.hpp:19</a></div></div>
<div class="ttc" id="aclassMaster_html_a2418abd3c0d0e9f4db769335cadd7545"><div class="ttname"><a href="classMaster.html#a2418abd3c0d0e9f4db769335cadd7545">Master::_amount</a></div><div class="ttdeci">static int _amount</div><div class="ttdoc">&lt; The higher one</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00020">Master.hpp:20</a></div></div>
<div class="ttc" id="aclassMaster_html_a2930920309de02e86050a8facdc83b68"><div class="ttname"><a href="classMaster.html#a2930920309de02e86050a8facdc83b68">Master::_address</a></div><div class="ttdeci">struct sockaddr_in _address</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00007">Master.hpp:7</a></div></div>
<div class="ttc" id="aclassMaster_html_a3ffb0ce7702a04ab7a9ec5dfa1ff6e42"><div class="ttname"><a href="classMaster.html#a3ffb0ce7702a04ab7a9ec5dfa1ff6e42">Master::post_select</a></div><div class="ttdeci">void post_select(Env *env)</div><div class="ttdef"><b>Definition:</b> <a href="Master_8cpp_source.html#l00065">Master.cpp:65</a></div></div>
<div class="ttc" id="aclassMaster_html_a40b24ae083809951e7d3e1a08d06fe65"><div class="ttname"><a href="classMaster.html#a40b24ae083809951e7d3e1a08d06fe65">Master::_max_fd</a></div><div class="ttdeci">static int _max_fd</div><div class="ttdoc">&lt; The lower socket fd</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00020">Master.hpp:20</a></div></div>
<div class="ttc" id="aclassMaster_html_a5486cb0d32ba29cd31b212c3457942b1"><div class="ttname"><a href="classMaster.html#a5486cb0d32ba29cd31b212c3457942b1">Master::choose_server</a></div><div class="ttdeci">Server * choose_server(Env *env, string host)</div><div class="ttdef"><b>Definition:</b> <a href="Master_8cpp_source.html#l00113">Master.cpp:113</a></div></div>
<div class="ttc" id="aclassMaster_html_a6c0dd4e4c7de17dea3de77f28e1de308"><div class="ttname"><a href="classMaster.html#a6c0dd4e4c7de17dea3de77f28e1de308">Master::_min_fd</a></div><div class="ttdeci">static int _min_fd</div><div class="ttdoc">&lt; The sockets fd which will be select</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00020">Master.hpp:20</a></div></div>
<div class="ttc" id="aclassMaster_html_aa129a09fad260366b16aa04a7de173c2"><div class="ttname"><a href="classMaster.html#aa129a09fad260366b16aa04a7de173c2">Master::pre_select</a></div><div class="ttdeci">void pre_select(void)</div><div class="ttdef"><b>Definition:</b> <a href="Master_8cpp_source.html#l00050">Master.cpp:50</a></div></div>
<div class="ttc" id="aclassMaster_html_aa76c335c36c93e8134115733938651df"><div class="ttname"><a href="classMaster.html#aa76c335c36c93e8134115733938651df">Master::~Master</a></div><div class="ttdeci">~Master(void)</div><div class="ttdef"><b>Definition:</b> <a href="Master_8cpp_source.html#l00011">Master.cpp:11</a></div></div>
<div class="ttc" id="aclassMaster_html_aee2fccb9a95dd83c89049c86a86ff5f3"><div class="ttname"><a href="classMaster.html#aee2fccb9a95dd83c89049c86a86ff5f3">Master::_fd</a></div><div class="ttdeci">int _fd</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00005">Master.hpp:5</a></div></div>
<div class="ttc" id="aclassMaster_html_af169284c429812878d318cd2fb009254"><div class="ttname"><a href="classMaster.html#af169284c429812878d318cd2fb009254">Master::Master</a></div><div class="ttdeci">Master(int fd, Master *parent)</div></div>
<div class="ttc" id="aclassMaster_html_af4afc9ab34343b13939139087e280472"><div class="ttname"><a href="classMaster.html#af4afc9ab34343b13939139087e280472">Master::_childs</a></div><div class="ttdeci">std::vector&lt; Client * &gt; _childs</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00006">Master.hpp:6</a></div></div>
<div class="ttc" id="aclassMaster_html_af5432a935125075c1eb03aa9e8c8f894"><div class="ttname"><a href="classMaster.html#af5432a935125075c1eb03aa9e8c8f894">Master::_listen</a></div><div class="ttdeci">ip_port_t _listen</div><div class="ttdef"><b>Definition:</b> <a href="Master_8hpp_source.html#l00018">Master.hpp:18</a></div></div>
<div class="ttc" id="aclassServer_html"><div class="ttname"><a href="classServer.html">Server</a></div><div class="ttdef"><b>Definition:</b> <a href="Server_8hpp_source.html#l00004">Server.hpp:4</a></div></div>
<div class="ttc" id="astructip__port__s_html"><div class="ttname"><a href="structip__port__s.html">ip_port_s</a></div><div class="ttdef"><b>Definition:</b> <a href="webserv_8hpp_source.html#l00035">webserv.hpp:35</a></div></div>
<div class="ttc" id="awebserv_8hpp_html"><div class="ttname"><a href="webserv_8hpp.html">webserv.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>