| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.5"/> |
| <title>Apache Mesos: 3rdparty/libprocess/src/poll_socket.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="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 style="height: 56px;"> |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname">Apache Mesos |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.5 --> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="pages.html"><span>Related Pages</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li><a href="annotated.html"><span>Classes</span></a></li> |
| <li class="current"><a href="files.html"><span>Files</span></a></li> |
| <li><a href="examples.html"><span>Examples</span></a></li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="files.html"><span>File List</span></a></li> |
| <li><a href="globals.html"><span>File Members</span></a></li> |
| </ul> |
| </div> |
| <div id="nav-path" class="navpath"> |
| <ul> |
| <li class="navelem"><a class="el" href="dir_8cab8f464681f7cc51cee77e79a434cd.html">3rdparty</a></li><li class="navelem"><a class="el" href="dir_043a76de98701f9bddf61b5e98f305ff.html">libprocess</a></li><li class="navelem"><a class="el" href="dir_01cbbd8dcbf9de3825992568658f467e.html">src</a></li> </ul> |
| </div> |
| </div><!-- top --> |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">poll_socket.hpp</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <a href="poll__socket_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div> |
| <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// you may not use this file except in compliance with the License.</span></div> |
| <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// You may obtain a copy of the License at</span></div> |
| <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div> |
| <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div> |
| <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">//</span></div> |
| <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div> |
| <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div> |
| <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div> |
| <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// See the License for the specific language governing permissions and</span></div> |
| <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// limitations under the License</span></div> |
| <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div> |
| <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <memory></span></div> |
| <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div> |
| <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <<a class="code" href="libprocess_2include_2process_2socket_8hpp.html">process/socket.hpp</a>></span></div> |
| <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div> |
| <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <<a class="code" href="try_8hpp.html">stout/try.hpp</a>></span></div> |
| <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div> |
| <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">namespace </span><a class="code" href="namespaceos.html#ae19e4161a51b86a1f330f3bf1dc75389">process</a> {</div> |
| <div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">namespace </span>network {</div> |
| <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">namespace </span>internal {</div> |
| <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div> |
| <div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html"> 23</a></span> <span class="keyword">class </span><a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html">PollSocketImpl</a> : <span class="keyword">public</span> <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html">SocketImpl</a></div> |
| <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> {</div> |
| <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">public</span>:</div> |
| <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keyword">static</span> <a class="code" href="classTry.html">Try<std::shared_ptr<SocketImpl></a>> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#af893115c4d9b82346bbf2a204de9c516">create</a>(<a class="code" href="int__fd_8hpp.html#aea4dbda01c90455f158ffa9b924c2f07">int_fd</a> <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#a303670cfc45c0e1a564fec0532320804">s</a>);</div> |
| <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div> |
| <div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a7dc8a9fdc548910d842505702e84585d"> 28</a></span>  <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a7dc8a9fdc548910d842505702e84585d">PollSocketImpl</a>(<a class="code" href="int__fd_8hpp.html#aea4dbda01c90455f158ffa9b924c2f07">int_fd</a> s) : <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html">SocketImpl</a>(s) {}</div> |
| <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div> |
| <div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a183161b9ce84fc906788531adb39b1f1"> 30</a></span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a183161b9ce84fc906788531adb39b1f1">~PollSocketImpl</a>() {}</div> |
| <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div> |
| <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="comment">// Implementation of the SocketImpl interface.</span></div> |
| <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">virtual</span> <a class="code" href="classTry.html">Try<Nothing></a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#ae17fa1d49cfda7a19b5bf8eb3f4a0ebc">listen</a>(<span class="keywordtype">int</span> backlog);</div> |
| <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1Future.html">Future<std::shared_ptr<SocketImpl></a>> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a26188c98728621ed4bdabc7087c46064">accept</a>();</div> |
| <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1Future.html">Future<Nothing></a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a217849468a99bd63d10a8f8acfb2e496">connect</a>(<span class="keyword">const</span> <a class="code" href="classprocess_1_1network_1_1Address.html">Address</a>& <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#a2289c8b4a10fae48e88518019c900c5a">address</a>);</div> |
| <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1Future.html">Future<size_t></a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a25882be4a54fbd7040e8a2ea707d5a33">recv</a>(<span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> <a class="code" href="namespaceos_1_1stat.html#aac17a91dd3f91341b8c4021025e89b04">size</a>);</div> |
| <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1Future.html">Future<size_t></a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a809de92dbb8bc53a253542af04afad7d">send</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> <a class="code" href="namespaceos_1_1stat.html#aac17a91dd3f91341b8c4021025e89b04">size</a>);</div> |
| <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1Future.html">Future<size_t></a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#abe4968408350df83e9ad194bc1dcce1b">sendfile</a>(<a class="code" href="int__fd_8hpp.html#aea4dbda01c90455f158ffa9b924c2f07">int_fd</a> fd, off_t offset, <span class="keywordtype">size_t</span> <a class="code" href="namespaceos_1_1stat.html#aac17a91dd3f91341b8c4021025e89b04">size</a>);</div> |
| <div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#ad2a592d7183b723c98ace8391f321632"> 39</a></span>  <span class="keyword">virtual</span> <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#ab1b898c86d5d9d449a65381c2b1d74f5">Kind</a> <a class="code" href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#ad2a592d7183b723c98ace8391f321632">kind</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#ab1b898c86d5d9d449a65381c2b1d74f5a48798d6fe72649c6d013e60081c38d9a">SocketImpl::Kind::POLL</a>; }</div> |
| <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> };</div> |
| <div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div> |
| <div class="line"><a name="l00042"></a><span class="lineno"> 42</span> } <span class="comment">// namespace internal {</span></div> |
| <div class="line"><a name="l00043"></a><span class="lineno"> 43</span> } <span class="comment">// namespace network {</span></div> |
| <div class="line"><a name="l00044"></a><span class="lineno"> 44</span> } <span class="comment">// namespace process {</span></div> |
| <div class="ttc" id="classTry_html"><div class="ttname"><a href="classTry.html">Try</a></div><div class="ttdef"><b>Definition:</b> try.hpp:34</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_ad2a592d7183b723c98ace8391f321632"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#ad2a592d7183b723c98ace8391f321632">process::network::internal::PollSocketImpl::kind</a></div><div class="ttdeci">virtual Kind kind() const </div><div class="ttdef"><b>Definition:</b> poll_socket.hpp:39</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a7dc8a9fdc548910d842505702e84585d"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a7dc8a9fdc548910d842505702e84585d">process::network::internal::PollSocketImpl::PollSocketImpl</a></div><div class="ttdeci">PollSocketImpl(int_fd s)</div><div class="ttdef"><b>Definition:</b> poll_socket.hpp:28</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1SocketImpl_html_a303670cfc45c0e1a564fec0532320804"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#a303670cfc45c0e1a564fec0532320804">process::network::internal::SocketImpl::s</a></div><div class="ttdeci">int_fd s</div><div class="ttdef"><b>Definition:</b> socket.hpp:229</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1SocketImpl_html_ab1b898c86d5d9d449a65381c2b1d74f5"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#ab1b898c86d5d9d449a65381c2b1d74f5">process::network::internal::SocketImpl::Kind</a></div><div class="ttdeci">Kind</div><div class="ttdoc">Available kinds of implementations. </div><div class="ttdef"><b>Definition:</b> socket.hpp:64</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1Address_html"><div class="ttname"><a href="classprocess_1_1network_1_1Address.html">process::network::Address</a></div><div class="ttdef"><b>Definition:</b> address.hpp:59</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1SocketImpl_html_ab1b898c86d5d9d449a65381c2b1d74f5a48798d6fe72649c6d013e60081c38d9a"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#ab1b898c86d5d9d449a65381c2b1d74f5a48798d6fe72649c6d013e60081c38d9a">process::network::internal::SocketImpl::Kind::POLL</a></div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a26188c98728621ed4bdabc7087c46064"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a26188c98728621ed4bdabc7087c46064">process::network::internal::PollSocketImpl::accept</a></div><div class="ttdeci">virtual Future< std::shared_ptr< SocketImpl > > accept()</div><div class="ttdoc">Returns an implementation corresponding to the next pending connection for the listening socket...</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1SocketImpl_html_a2289c8b4a10fae48e88518019c900c5a"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1SocketImpl.html#a2289c8b4a10fae48e88518019c900c5a">process::network::internal::SocketImpl::address</a></div><div class="ttdeci">Try< Address > address() const </div><div class="ttdoc">Returns the Address with the assigned ip and assigned port. </div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1SocketImpl_html"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1SocketImpl.html">process::network::internal::SocketImpl</a></div><div class="ttdoc">Implementation interface for a Socket. </div><div class="ttdef"><b>Definition:</b> socket.hpp:55</div></div> |
| <div class="ttc" id="libprocess_2include_2process_2socket_8hpp_html"><div class="ttname"><a href="libprocess_2include_2process_2socket_8hpp.html">socket.hpp</a></div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_af893115c4d9b82346bbf2a204de9c516"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#af893115c4d9b82346bbf2a204de9c516">process::network::internal::PollSocketImpl::create</a></div><div class="ttdeci">static Try< std::shared_ptr< SocketImpl > > create(int_fd s)</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html">process::network::internal::PollSocketImpl</a></div><div class="ttdef"><b>Definition:</b> poll_socket.hpp:23</div></div> |
| <div class="ttc" id="namespaceos_1_1stat_html_aac17a91dd3f91341b8c4021025e89b04"><div class="ttname"><a href="namespaceos_1_1stat.html#aac17a91dd3f91341b8c4021025e89b04">os::stat::size</a></div><div class="ttdeci">Try< Bytes > size(const std::string &path, const FollowSymlink follow=FOLLOW_SYMLINK)</div><div class="ttdef"><b>Definition:</b> stat.hpp:88</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_ae17fa1d49cfda7a19b5bf8eb3f4a0ebc"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#ae17fa1d49cfda7a19b5bf8eb3f4a0ebc">process::network::internal::PollSocketImpl::listen</a></div><div class="ttdeci">virtual Try< Nothing > listen(int backlog)</div></div> |
| <div class="ttc" id="namespaceos_html_ae19e4161a51b86a1f330f3bf1dc75389"><div class="ttname"><a href="namespaceos.html#ae19e4161a51b86a1f330f3bf1dc75389">os::process</a></div><div class="ttdeci">Result< Process > process(pid_t pid)</div><div class="ttdef"><b>Definition:</b> freebsd.hpp:30</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a809de92dbb8bc53a253542af04afad7d"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a809de92dbb8bc53a253542af04afad7d">process::network::internal::PollSocketImpl::send</a></div><div class="ttdeci">virtual Future< size_t > send(const char *data, size_t size)</div></div> |
| <div class="ttc" id="try_8hpp_html"><div class="ttname"><a href="try_8hpp.html">try.hpp</a></div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a25882be4a54fbd7040e8a2ea707d5a33"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a25882be4a54fbd7040e8a2ea707d5a33">process::network::internal::PollSocketImpl::recv</a></div><div class="ttdeci">virtual Future< size_t > recv(char *data, size_t size)</div></div> |
| <div class="ttc" id="int__fd_8hpp_html_aea4dbda01c90455f158ffa9b924c2f07"><div class="ttname"><a href="int__fd_8hpp.html#aea4dbda01c90455f158ffa9b924c2f07">int_fd</a></div><div class="ttdeci">int int_fd</div><div class="ttdef"><b>Definition:</b> int_fd.hpp:35</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_abe4968408350df83e9ad194bc1dcce1b"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#abe4968408350df83e9ad194bc1dcce1b">process::network::internal::PollSocketImpl::sendfile</a></div><div class="ttdeci">virtual Future< size_t > sendfile(int_fd fd, off_t offset, size_t size)</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a217849468a99bd63d10a8f8acfb2e496"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a217849468a99bd63d10a8f8acfb2e496">process::network::internal::PollSocketImpl::connect</a></div><div class="ttdeci">virtual Future< Nothing > connect(const Address &address)</div></div> |
| <div class="ttc" id="classprocess_1_1network_1_1internal_1_1PollSocketImpl_html_a183161b9ce84fc906788531adb39b1f1"><div class="ttname"><a href="classprocess_1_1network_1_1internal_1_1PollSocketImpl.html#a183161b9ce84fc906788531adb39b1f1">process::network::internal::PollSocketImpl::~PollSocketImpl</a></div><div class="ttdeci">virtual ~PollSocketImpl()</div><div class="ttdef"><b>Definition:</b> poll_socket.hpp:30</div></div> |
| <div class="ttc" id="classprocess_1_1Future_html"><div class="ttname"><a href="classprocess_1_1Future.html">process::Future</a></div><div class="ttdef"><b>Definition:</b> future.hpp:56</div></div> |
| </div><!-- fragment --></div><!-- contents --> |
| <!-- start footer part --> |
| <hr class="footer"/><address class="footer"><small> |
| Generated by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.5 |
| </small></address> |
| </body> |
| </html> |