source: flair-dev/trunk/doc/Flair/classflair_1_1core_1_1_socket.html@ 36

Last change on this file since 36 was 36, checked in by Sanahuja Guillaume, 6 years ago

m

File size: 28.8 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6<meta name="generator" content="Doxygen 1.8.9.1"/>
7<title>Flair: flair::core::Socket Class Reference</title>
8<link href="tabs.css" rel="stylesheet" type="text/css"/>
9<script type="text/javascript" src="jquery.js"></script>
10<script type="text/javascript" src="dynsections.js"></script>
11<link href="navtree.css" rel="stylesheet" type="text/css"/>
12<script type="text/javascript" src="resize.js"></script>
13<script type="text/javascript" src="navtreedata.js"></script>
14<script type="text/javascript" src="navtree.js"></script>
15<script type="text/javascript">
16 $(document).ready(initResizable);
17 $(window).load(resizeHeight);
18</script>
19<link href="search/search.css" rel="stylesheet" type="text/css"/>
20<script type="text/javascript" src="search/searchdata.js"></script>
21<script type="text/javascript" src="search/search.js"></script>
22<script type="text/javascript">
23 $(document).ready(function() { init_search(); });
24</script>
25<link href="doxygen.css" rel="stylesheet" type="text/css" />
26</head>
27<body>
28<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
29<div id="titlearea">
30<table cellspacing="0" cellpadding="0">
31 <tbody>
32 <tr style="height: 56px;">
33 <td id="projectlogo"><img alt="Logo" src="logo_hds.png"/></td>
34 <td style="padding-left: 0.5em;">
35 <div id="projectname">Flair
36 </div>
37 <div id="projectbrief">Framework Libre Air</div>
38 </td>
39 </tr>
40 </tbody>
41</table>
42</div>
43<!-- end header part -->
44<!-- Generated by Doxygen 1.8.9.1 -->
45<script type="text/javascript">
46var searchBox = new SearchBox("searchBox", "search",false,'Search');
47</script>
48 <div id="navrow1" class="tabs">
49 <ul class="tablist">
50 <li><a href="index.html"><span>Main&#160;Page</span></a></li>
51 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
52 <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
53 <li><a href="files.html"><span>Files</span></a></li>
54 <li>
55 <div id="MSearchBox" class="MSearchBoxInactive">
56 <span class="left">
57 <img id="MSearchSelect" src="search/mag_sel.png"
58 onmouseover="return searchBox.OnSearchSelectShow()"
59 onmouseout="return searchBox.OnSearchSelectHide()"
60 alt=""/>
61 <input type="text" id="MSearchField" value="Search" accesskey="S"
62 onfocus="searchBox.OnSearchFieldFocus(true)"
63 onblur="searchBox.OnSearchFieldFocus(false)"
64 onkeyup="searchBox.OnSearchFieldChange(event)"/>
65 </span><span class="right">
66 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
67 </span>
68 </div>
69 </li>
70 </ul>
71 </div>
72 <div id="navrow2" class="tabs2">
73 <ul class="tablist">
74 <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
75 <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
76 <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
77 <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
78 </ul>
79 </div>
80</div><!-- top -->
81<div id="side-nav" class="ui-resizable side-nav-resizable">
82 <div id="nav-tree">
83 <div id="nav-tree-contents">
84 <div id="nav-sync" class="sync"></div>
85 </div>
86 </div>
87 <div id="splitbar" style="-moz-user-select:none;"
88 class="ui-resizable-handle">
89 </div>
90</div>
91<script type="text/javascript">
92$(document).ready(function(){initNavTree('classflair_1_1core_1_1_socket.html','');});
93</script>
94<div id="doc-content">
95<!-- window showing the filter options -->
96<div id="MSearchSelectWindow"
97 onmouseover="return searchBox.OnSearchSelectShow()"
98 onmouseout="return searchBox.OnSearchSelectHide()"
99 onkeydown="return searchBox.OnSearchSelectKey(event)">
100</div>
101
102<!-- iframe showing the search results (closed by default) -->
103<div id="MSearchResultsWindow">
104<iframe src="javascript:void(0)" frameborder="0"
105 name="MSearchResults" id="MSearchResults">
106</iframe>
107</div>
108
109<div class="header">
110 <div class="summary">
111<a href="#pub-methods">Public Member Functions</a> &#124;
112<a href="classflair_1_1core_1_1_socket-members.html">List of all members</a> </div>
113 <div class="headertitle">
114<div class="title">flair::core::Socket Class Reference</div> </div>
115</div><!--header-->
116<div class="contents">
117
118<p>Class encapsulating a UDP socket. It assumes packets are coming from only one distant host on a given port.
119 <a href="classflair_1_1core_1_1_socket.html#details">More...</a></p>
120
121<p><code>#include &lt;<a class="el" href="_socket_8h_source.html">Socket.h</a>&gt;</code></p>
122<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
123 <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for flair::core::Socket:</div>
124<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
125</div>
126<div id="dynsection-0-content" class="dyncontent" style="display:none;">
127 <div class="center">
128 <img src="classflair_1_1core_1_1_socket.png" usemap="#flair::core::Socket_map" alt=""/>
129 <map id="flair::core::Socket_map" name="flair::core::Socket_map">
130<area href="classflair_1_1core_1_1_object.html" title="Base class for all Framework&#39;s classes. " alt="flair::core::Object" shape="rect" coords="0,0,110,24"/>
131</map>
132 </div></div>
133<table class="memberdecls">
134<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
135Public Member Functions</h2></td></tr>
136<tr class="memitem:aca27bc21b18df08ae8282181f6492313"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#aca27bc21b18df08ae8282181f6492313">Socket</a> (const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *parent, std::string name, std::string address, bool broadcast=false)</td></tr>
137<tr class="memdesc:aca27bc21b18df08ae8282181f6492313"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#aca27bc21b18df08ae8282181f6492313">More...</a><br /></td></tr>
138<tr class="separator:aca27bc21b18df08ae8282181f6492313"><td class="memSeparator" colspan="2">&#160;</td></tr>
139<tr class="memitem:af06b25a783310b900c52bafeb99d7813"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#af06b25a783310b900c52bafeb99d7813">Socket</a> (const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *parent, std::string name, uint16_t port)</td></tr>
140<tr class="memdesc:af06b25a783310b900c52bafeb99d7813"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#af06b25a783310b900c52bafeb99d7813">More...</a><br /></td></tr>
141<tr class="separator:af06b25a783310b900c52bafeb99d7813"><td class="memSeparator" colspan="2">&#160;</td></tr>
142<tr class="memitem:a70410169166f46e51a9eea61af51286a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#a70410169166f46e51a9eea61af51286a">~Socket</a> ()</td></tr>
143<tr class="memdesc:a70410169166f46e51a9eea61af51286a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a70410169166f46e51a9eea61af51286a">More...</a><br /></td></tr>
144<tr class="separator:a70410169166f46e51a9eea61af51286a"><td class="memSeparator" colspan="2">&#160;</td></tr>
145<tr class="memitem:a5675766254a1fca34d42b406cbe324fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#a5675766254a1fca34d42b406cbe324fd">SendMessage</a> (std::string message)</td></tr>
146<tr class="memdesc:a5675766254a1fca34d42b406cbe324fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a message. <a href="#a5675766254a1fca34d42b406cbe324fd">More...</a><br /></td></tr>
147<tr class="separator:a5675766254a1fca34d42b406cbe324fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
148<tr class="memitem:a007eb44554d491551fd26d975d181a41"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#a007eb44554d491551fd26d975d181a41">SendMessage</a> (const char *message, size_t message_len)</td></tr>
149<tr class="memdesc:a007eb44554d491551fd26d975d181a41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a message. <a href="#a007eb44554d491551fd26d975d181a41">More...</a><br /></td></tr>
150<tr class="separator:a007eb44554d491551fd26d975d181a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
151<tr class="memitem:a6b83e7fdf7a828a7a02ba2f867c4d973"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_socket.html#a6b83e7fdf7a828a7a02ba2f867c4d973">RecvMessage</a> (char *buf, size_t buf_len, <a class="el" href="namespaceflair_1_1core.html#acc0fa041e08ecf73b2d1d723c339a736">Time</a> timeout, char *src=NULL, size_t *src_len=NULL)</td></tr>
152<tr class="memdesc:a6b83e7fdf7a828a7a02ba2f867c4d973"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive a message. <a href="#a6b83e7fdf7a828a7a02ba2f867c4d973">More...</a><br /></td></tr>
153<tr class="separator:a6b83e7fdf7a828a7a02ba2f867c4d973"><td class="memSeparator" colspan="2">&#160;</td></tr>
154<tr class="memitem:a60b8f46da65f1401012db4cb449992eb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a60b8f46da65f1401012db4cb449992eb"></a>
155void&#160;</td><td class="memItemRight" valign="bottom"><b>NetworkToHost</b> (char *data, size_t dataSize)</td></tr>
156<tr class="separator:a60b8f46da65f1401012db4cb449992eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
157<tr class="memitem:a955291105192f6599ab6251c6959ad5f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a955291105192f6599ab6251c6959ad5f"></a>
158void&#160;</td><td class="memItemRight" valign="bottom"><b>HostToNetwork</b> (char *data, size_t dataSize)</td></tr>
159<tr class="separator:a955291105192f6599ab6251c6959ad5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
160<tr class="inherit_header pub_methods_classflair_1_1core_1_1_object"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classflair_1_1core_1_1_object')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classflair_1_1core_1_1_object.html">flair::core::Object</a></td></tr>
161<tr class="memitem:aec92383fd5bf68d9df10414862b7e95c inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#aec92383fd5bf68d9df10414862b7e95c">Object</a> (const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *parent=NULL, std::string name=&quot;&quot;, std::string type=&quot;&quot;)</td></tr>
162<tr class="memdesc:aec92383fd5bf68d9df10414862b7e95c inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#aec92383fd5bf68d9df10414862b7e95c">More...</a><br /></td></tr>
163<tr class="separator:aec92383fd5bf68d9df10414862b7e95c inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
164<tr class="memitem:aa2bde0e6677bbef705c96c93cb06ad09 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#aa2bde0e6677bbef705c96c93cb06ad09">~Object</a> ()</td></tr>
165<tr class="memdesc:aa2bde0e6677bbef705c96c93cb06ad09 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#aa2bde0e6677bbef705c96c93cb06ad09">More...</a><br /></td></tr>
166<tr class="separator:aa2bde0e6677bbef705c96c93cb06ad09 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
167<tr class="memitem:a9b0344dff7e1c05424d9152c8274523a inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a9b0344dff7e1c05424d9152c8274523a">ObjectName</a> (void) const </td></tr>
168<tr class="memdesc:a9b0344dff7e1c05424d9152c8274523a inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name. <a href="#a9b0344dff7e1c05424d9152c8274523a">More...</a><br /></td></tr>
169<tr class="separator:a9b0344dff7e1c05424d9152c8274523a inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
170<tr class="memitem:a609a250ec037fbcaf8957c8f1dcbfc53 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a609a250ec037fbcaf8957c8f1dcbfc53">ObjectType</a> (void) const </td></tr>
171<tr class="memdesc:a609a250ec037fbcaf8957c8f1dcbfc53 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type. <a href="#a609a250ec037fbcaf8957c8f1dcbfc53">More...</a><br /></td></tr>
172<tr class="separator:a609a250ec037fbcaf8957c8f1dcbfc53 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
173<tr class="memitem:a360c112cc3017a5152ebf6e84d2efa70 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a360c112cc3017a5152ebf6e84d2efa70">Parent</a> (void) const </td></tr>
174<tr class="memdesc:a360c112cc3017a5152ebf6e84d2efa70 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parent. <a href="#a360c112cc3017a5152ebf6e84d2efa70">More...</a><br /></td></tr>
175<tr class="separator:a360c112cc3017a5152ebf6e84d2efa70 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
176<tr class="memitem:ae22db4d723ec2d50b3ba48f26a6a770c inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">std::vector&lt; const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#ae22db4d723ec2d50b3ba48f26a6a770c">TypeChilds</a> (void) const </td></tr>
177<tr class="memdesc:ae22db4d723ec2d50b3ba48f26a6a770c inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Childs of the same type. <a href="#ae22db4d723ec2d50b3ba48f26a6a770c">More...</a><br /></td></tr>
178<tr class="separator:ae22db4d723ec2d50b3ba48f26a6a770c inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
179<tr class="memitem:a344f81cd35805a9501098bf727ac1a10 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">std::vector&lt; const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a344f81cd35805a9501098bf727ac1a10">Childs</a> (void) const </td></tr>
180<tr class="memdesc:a344f81cd35805a9501098bf727ac1a10 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Childs. <a href="#a344f81cd35805a9501098bf727ac1a10">More...</a><br /></td></tr>
181<tr class="separator:a344f81cd35805a9501098bf727ac1a10 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
182<tr class="memitem:af001feba14fc053aa778e61080a0b4cf inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#af001feba14fc053aa778e61080a0b4cf">Information</a> (const char *function, int line, const char *format,...) const </td></tr>
183<tr class="memdesc:af001feba14fc053aa778e61080a0b4cf inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Formatted information. <a href="#af001feba14fc053aa778e61080a0b4cf">More...</a><br /></td></tr>
184<tr class="separator:af001feba14fc053aa778e61080a0b4cf inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
185<tr class="memitem:a168b18451b2ee6126e1e81d452005ff6 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a168b18451b2ee6126e1e81d452005ff6">Warning</a> (const char *function, const char *format,...) const </td></tr>
186<tr class="memdesc:a168b18451b2ee6126e1e81d452005ff6 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Formatted warning. <a href="#a168b18451b2ee6126e1e81d452005ff6">More...</a><br /></td></tr>
187<tr class="separator:a168b18451b2ee6126e1e81d452005ff6 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
188<tr class="memitem:a3ca9694d29ec2b0491739879685df5ca inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a3ca9694d29ec2b0491739879685df5ca">Error</a> (const char *function, const char *format,...) const </td></tr>
189<tr class="memdesc:a3ca9694d29ec2b0491739879685df5ca inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Formatted error. <a href="#a3ca9694d29ec2b0491739879685df5ca">More...</a><br /></td></tr>
190<tr class="separator:a3ca9694d29ec2b0491739879685df5ca inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
191<tr class="memitem:a36cdd7f556e78b1bddd1d1fe4264bb85 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflair_1_1core_1_1_object.html#a36cdd7f556e78b1bddd1d1fe4264bb85">ErrorOccured</a> (bool recursive=true) const </td></tr>
192<tr class="memdesc:a36cdd7f556e78b1bddd1d1fe4264bb85 inherit pub_methods_classflair_1_1core_1_1_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Has an errror occured? <a href="#a36cdd7f556e78b1bddd1d1fe4264bb85">More...</a><br /></td></tr>
193<tr class="separator:a36cdd7f556e78b1bddd1d1fe4264bb85 inherit pub_methods_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
194</table><table class="memberdecls">
195<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
196Additional Inherited Members</h2></td></tr>
197<tr class="inherit_header pub_types_classflair_1_1core_1_1_object"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classflair_1_1core_1_1_object')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classflair_1_1core_1_1_object.html">flair::core::Object</a></td></tr>
198<tr class="memitem:aed5fccda511f97487040fed29f4efc97 inherit pub_types_classflair_1_1core_1_1_object"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed5fccda511f97487040fed29f4efc97"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>color_t</b> { <b>Auto</b> = 0,
199<b>Red</b> = 31,
200<b>Green</b> = 32,
201<b>Orange</b> = 33
202 }</td></tr>
203<tr class="separator:aed5fccda511f97487040fed29f4efc97 inherit pub_types_classflair_1_1core_1_1_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
204</table>
205<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
206<div class="textblock"><p>Class encapsulating a UDP socket. It assumes packets are coming from only one distant host on a given port. </p>
207</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
208<a class="anchor" id="aca27bc21b18df08ae8282181f6492313"></a>
209<div class="memitem">
210<div class="memproto">
211 <table class="memname">
212 <tr>
213 <td class="memname">flair::core::Socket::Socket </td>
214 <td>(</td>
215 <td class="paramtype">const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *&#160;</td>
216 <td class="paramname"><em>parent</em>, </td>
217 </tr>
218 <tr>
219 <td class="paramkey"></td>
220 <td></td>
221 <td class="paramtype">std::string&#160;</td>
222 <td class="paramname"><em>name</em>, </td>
223 </tr>
224 <tr>
225 <td class="paramkey"></td>
226 <td></td>
227 <td class="paramtype">std::string&#160;</td>
228 <td class="paramname"><em>address</em>, </td>
229 </tr>
230 <tr>
231 <td class="paramkey"></td>
232 <td></td>
233 <td class="paramtype">bool&#160;</td>
234 <td class="paramname"><em>broadcast</em> = <code>false</code>&#160;</td>
235 </tr>
236 <tr>
237 <td></td>
238 <td>)</td>
239 <td></td><td></td>
240 </tr>
241 </table>
242</div><div class="memdoc">
243
244<p>Constructor. </p>
245<p>Construct the client side of the socket</p>
246<dl class="params"><dt>Parameters</dt><dd>
247 <table class="params">
248 <tr><td class="paramname">parent</td><td>parent </td></tr>
249 <tr><td class="paramname">name</td><td>name </td></tr>
250 <tr><td class="paramname">address</td><td>server address (ex 192.168.1.1:9000) </td></tr>
251 <tr><td class="paramname">broadcast</td><td>true if address is a broadcast address </td></tr>
252 </table>
253 </dd>
254</dl>
255
256</div>
257</div>
258<a class="anchor" id="af06b25a783310b900c52bafeb99d7813"></a>
259<div class="memitem">
260<div class="memproto">
261 <table class="memname">
262 <tr>
263 <td class="memname">flair::core::Socket::Socket </td>
264 <td>(</td>
265 <td class="paramtype">const <a class="el" href="classflair_1_1core_1_1_object.html">Object</a> *&#160;</td>
266 <td class="paramname"><em>parent</em>, </td>
267 </tr>
268 <tr>
269 <td class="paramkey"></td>
270 <td></td>
271 <td class="paramtype">std::string&#160;</td>
272 <td class="paramname"><em>name</em>, </td>
273 </tr>
274 <tr>
275 <td class="paramkey"></td>
276 <td></td>
277 <td class="paramtype">uint16_t&#160;</td>
278 <td class="paramname"><em>port</em>&#160;</td>
279 </tr>
280 <tr>
281 <td></td>
282 <td>)</td>
283 <td></td><td></td>
284 </tr>
285 </table>
286</div><div class="memdoc">
287
288<p>Constructor. </p>
289<p>Construct the server side of the socket</p>
290<dl class="params"><dt>Parameters</dt><dd>
291 <table class="params">
292 <tr><td class="paramname">parent</td><td>parent </td></tr>
293 <tr><td class="paramname">name</td><td>name </td></tr>
294 <tr><td class="paramname">port</td><td>listening port </td></tr>
295 </table>
296 </dd>
297</dl>
298
299</div>
300</div>
301<a class="anchor" id="a70410169166f46e51a9eea61af51286a"></a>
302<div class="memitem">
303<div class="memproto">
304 <table class="memname">
305 <tr>
306 <td class="memname">flair::core::Socket::~Socket </td>
307 <td>(</td>
308 <td class="paramname"></td><td>)</td>
309 <td></td>
310 </tr>
311 </table>
312</div><div class="memdoc">
313
314<p>Destructor. </p>
315
316</div>
317</div>
318<h2 class="groupheader">Member Function Documentation</h2>
319<a class="anchor" id="a5675766254a1fca34d42b406cbe324fd"></a>
320<div class="memitem">
321<div class="memproto">
322 <table class="memname">
323 <tr>
324 <td class="memname">void flair::core::Socket::SendMessage </td>
325 <td>(</td>
326 <td class="paramtype">std::string&#160;</td>
327 <td class="paramname"><em>message</em></td><td>)</td>
328 <td></td>
329 </tr>
330 </table>
331</div><div class="memdoc">
332
333<p>Send a message. </p>
334<p>In case of a broadcast <a class="el" href="classflair_1_1core_1_1_socket.html" title="Class encapsulating a UDP socket. It assumes packets are coming from only one distant host on a given...">Socket</a>, <a class="el" href="classflair_1_1core_1_1_object.html#a360c112cc3017a5152ebf6e84d2efa70" title="Parent. ">Parent()</a>-&gt;<a class="el" href="classflair_1_1core_1_1_object.html#a9b0344dff7e1c05424d9152c8274523a" title="Name. ">ObjectName()</a> is used as source of the message, this name should be unique.</p>
335<dl class="params"><dt>Parameters</dt><dd>
336 <table class="params">
337 <tr><td class="paramname">message</td><td>message </td></tr>
338 </table>
339 </dd>
340</dl>
341
342</div>
343</div>
344<a class="anchor" id="a007eb44554d491551fd26d975d181a41"></a>
345<div class="memitem">
346<div class="memproto">
347 <table class="memname">
348 <tr>
349 <td class="memname">void flair::core::Socket::SendMessage </td>
350 <td>(</td>
351 <td class="paramtype">const char *&#160;</td>
352 <td class="paramname"><em>message</em>, </td>
353 </tr>
354 <tr>
355 <td class="paramkey"></td>
356 <td></td>
357 <td class="paramtype">size_t&#160;</td>
358 <td class="paramname"><em>message_len</em>&#160;</td>
359 </tr>
360 <tr>
361 <td></td>
362 <td>)</td>
363 <td></td><td></td>
364 </tr>
365 </table>
366</div><div class="memdoc">
367
368<p>Send a message. </p>
369<dl class="params"><dt>Parameters</dt><dd>
370 <table class="params">
371 <tr><td class="paramname">message</td><td>message </td></tr>
372 <tr><td class="paramname">message_len</td><td>message length </td></tr>
373 </table>
374 </dd>
375</dl>
376
377</div>
378</div>
379<a class="anchor" id="a6b83e7fdf7a828a7a02ba2f867c4d973"></a>
380<div class="memitem">
381<div class="memproto">
382 <table class="memname">
383 <tr>
384 <td class="memname">ssize_t flair::core::Socket::RecvMessage </td>
385 <td>(</td>
386 <td class="paramtype">char *&#160;</td>
387 <td class="paramname"><em>buf</em>, </td>
388 </tr>
389 <tr>
390 <td class="paramkey"></td>
391 <td></td>
392 <td class="paramtype">size_t&#160;</td>
393 <td class="paramname"><em>buf_len</em>, </td>
394 </tr>
395 <tr>
396 <td class="paramkey"></td>
397 <td></td>
398 <td class="paramtype"><a class="el" href="namespaceflair_1_1core.html#acc0fa041e08ecf73b2d1d723c339a736">Time</a>&#160;</td>
399 <td class="paramname"><em>timeout</em>, </td>
400 </tr>
401 <tr>
402 <td class="paramkey"></td>
403 <td></td>
404 <td class="paramtype">char *&#160;</td>
405 <td class="paramname"><em>src</em> = <code>NULL</code>, </td>
406 </tr>
407 <tr>
408 <td class="paramkey"></td>
409 <td></td>
410 <td class="paramtype">size_t *&#160;</td>
411 <td class="paramname"><em>src_len</em> = <code>NULL</code>&#160;</td>
412 </tr>
413 <tr>
414 <td></td>
415 <td>)</td>
416 <td></td><td></td>
417 </tr>
418 </table>
419</div><div class="memdoc">
420
421<p>Receive a message. </p>
422<p>Receive a message and wait up to timeout. <br />
423If src and src_len are specified, the source of the message will be copied in the src buffer. <br />
424Note that in case of a broadcast socket, own messages are filtered and are not received.</p>
425<dl class="params"><dt>Parameters</dt><dd>
426 <table class="params">
427 <tr><td class="paramname">buf</td><td>buffer to put the message </td></tr>
428 <tr><td class="paramname">buf_len</td><td>buffer length </td></tr>
429 <tr><td class="paramname">timeout</td><td>timeout </td></tr>
430 <tr><td class="paramname">src</td><td>buffer to put source name </td></tr>
431 <tr><td class="paramname">src_len</td><td>buffer length</td></tr>
432 </table>
433 </dd>
434</dl>
435<dl class="section return"><dt>Returns</dt><dd>size of the received message </dd></dl>
436
437</div>
438</div>
439</div><!-- contents -->
440</div><!-- doc-content -->
441<!-- start footer part -->
442<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
443 <ul>
444 <li class="navelem"><a class="el" href="namespaceflair.html">flair</a></li><li class="navelem"><a class="el" href="namespaceflair_1_1core.html">core</a></li><li class="navelem"><a class="el" href="classflair_1_1core_1_1_socket.html">Socket</a></li>
445 <li class="footer">Generated on Thu Nov 3 2016 10:06:12 for Flair by
446 <a href="http://www.doxygen.org/index.html">
447 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
448 </ul>
449</div>
450</body>
451</html>
Note: See TracBrowser for help on using the repository browser.