123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <!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">
- <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.16"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Socket Server: SocketListener Class Reference</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 style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">Socket Server
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.16 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(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">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- </div><!-- top -->
- <div class="header">
- <div class="summary">
- <a href="#nested-classes">Classes</a> |
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="classSocketListener-members.html">List of all members</a> </div>
- <div class="headertitle">
- <div class="title">SocketListener Class Reference</div> </div>
- </div><!--header-->
- <div class="contents">
- <p><code>#include <<a class="el" href="socket__listener_8h_source.html">socket_listener.h</a>></code></p>
- <div class="dynheader">
- Inheritance diagram for SocketListener:</div>
- <div class="dyncontent">
- <div class="center">
- <img src="classSocketListener.png" usemap="#SocketListener_map" alt=""/>
- <map id="SocketListener_map" name="SocketListener_map">
- <area href="classSendInterface.html" alt="SendInterface" shape="rect" coords="0,0,95,24"/>
- </map>
- </div></div>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
- Classes</h2></td></tr>
- <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener_1_1MessageHandler.html">MessageHandler</a></td></tr>
- <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:af957cc189529396c90aae6aaa7cf0c69"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#af957cc189529396c90aae6aaa7cf0c69">SocketListener</a> (std::string ipAddress, int port)</td></tr>
- <tr class="separator:af957cc189529396c90aae6aaa7cf0c69"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a061fcf8b47360d4410fcbd2af1e34b7a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#a061fcf8b47360d4410fcbd2af1e34b7a">~SocketListener</a> ()</td></tr>
- <tr class="separator:a061fcf8b47360d4410fcbd2af1e34b7a"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a47a9f1bbbe160e06bb8b97118ed96c57"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#a47a9f1bbbe160e06bb8b97118ed96c57">sendMessage</a> (int client_socket_fd, std::shared_ptr< char[]> buffer) override</td></tr>
- <tr class="separator:a47a9f1bbbe160e06bb8b97118ed96c57"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a4d1d1dba518b37ebb60151a17e7cb238"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSocketListener_1_1MessageHandler.html">MessageHandler</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#a4d1d1dba518b37ebb60151a17e7cb238">createMessageHandler</a> (std::function< void()> cb)</td></tr>
- <tr class="separator:a4d1d1dba518b37ebb60151a17e7cb238"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ac15f68258fc51e00de3ecb8fad336773"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#ac15f68258fc51e00de3ecb8fad336773">init</a> ()</td></tr>
- <tr class="separator:ac15f68258fc51e00de3ecb8fad336773"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a40a414e609215442d19ca6c58d4a2302"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#a40a414e609215442d19ca6c58d4a2302">run</a> ()</td></tr>
- <tr class="separator:a40a414e609215442d19ca6c58d4a2302"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a2b2ffb4e2977a2f3e000151dd7b228ad"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocketListener.html#a2b2ffb4e2977a2f3e000151dd7b228ad">cleanup</a> ()</td></tr>
- <tr class="separator:a2b2ffb4e2977a2f3e000151dd7b228ad"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <h2 class="groupheader">Constructor & Destructor Documentation</h2>
- <a id="af957cc189529396c90aae6aaa7cf0c69"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#af957cc189529396c90aae6aaa7cf0c69">◆ </a></span>SocketListener()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">SocketListener::SocketListener </td>
- <td>(</td>
- <td class="paramtype">std::string </td>
- <td class="paramname"><em>ip_address</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>port</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Constructor Initialize with ip_address, port and message_handler </p>
- </div>
- </div>
- <a id="a061fcf8b47360d4410fcbd2af1e34b7a"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a061fcf8b47360d4410fcbd2af1e34b7a">◆ </a></span>~SocketListener()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">SocketListener::~SocketListener </td>
- <td>(</td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Destructor TODO: Determine if we should make buffer a class member </p>
- </div>
- </div>
- <h2 class="groupheader">Member Function Documentation</h2>
- <a id="a2b2ffb4e2977a2f3e000151dd7b228ad"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a2b2ffb4e2977a2f3e000151dd7b228ad">◆ </a></span>cleanup()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void SocketListener::cleanup </td>
- <td>(</td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Perform any cleanup work</p>
- <p>cleanUp @method TODO: Determine if we should be cleaning up buffer memory </p>
- </div>
- </div>
- <a id="a4d1d1dba518b37ebb60151a17e7cb238"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a4d1d1dba518b37ebb60151a17e7cb238">◆ </a></span>createMessageHandler()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="classSocketListener_1_1MessageHandler.html">SocketListener::MessageHandler</a> SocketListener::createMessageHandler </td>
- <td>(</td>
- <td class="paramtype">std::function< void()> </td>
- <td class="paramname"><em>cb</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a id="ac15f68258fc51e00de3ecb8fad336773"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ac15f68258fc51e00de3ecb8fad336773">◆ </a></span>init()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">bool SocketListener::init </td>
- <td>(</td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Perform intialization work</p>
- <p>init TODO: Initialize buffer memory, if buffer is to be a class member </p>
- </div>
- </div>
- <a id="a40a414e609215442d19ca6c58d4a2302"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a40a414e609215442d19ca6c58d4a2302">◆ </a></span>run()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void SocketListener::run </td>
- <td>(</td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Main message loop</p>
- <p>run @method Main message loop TODO: Implement multithreading </p>
- </div>
- </div>
- <a id="a47a9f1bbbe160e06bb8b97118ed96c57"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a47a9f1bbbe160e06bb8b97118ed96c57">◆ </a></span>sendMessage()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void SocketListener::sendMessage </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>client_socket_fd</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">std::shared_ptr< char[]> </td>
- <td class="paramname"><em>s_ptr</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Send a message to a client socket described by its file descriptor </p><dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">{int}</td><td>client_socket_fd The client socket file descriptor </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">{std::string}</td><td>The message to be sent</td></tr>
- </table>
- </dd>
- </dl>
- <p>sendMessage @method Send a null-terminated array of characters, supplied as a const char pointer, to a client socket described by its file descriptor </p>
- <p>Implements <a class="el" href="classSendInterface.html#a2475e2b3ffaf5591b6e73d66d6a0a308">SendInterface</a>.</p>
- </div>
- </div>
- <hr/>The documentation for this class was generated from the following files:<ul>
- <li>headers/<a class="el" href="socket__listener_8h_source.html">socket_listener.h</a></li>
- <li><a class="el" href="socket__listener_8cpp.html">socket_listener.cpp</a></li>
- </ul>
- </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.16
- </small></address>
- </body>
- </html>
|