1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
|
<!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"/>
<title>enet: ENet peer functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div 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="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>ENet peer functions</h1> </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#gab35807c848b6c88af12ce8476dffbc84">enet_peer_throttle_configure</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> interval, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> acceleration, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> deceleration)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Configures throttle parameter for a peer. <a href="#gab35807c848b6c88af12ce8476dffbc84"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga52c5c6b1bbd807466298b2d7ed12fdd6"></a><!-- doxytag: member="peer::enet_peer_throttle" ref="ga52c5c6b1bbd807466298b2d7ed12fdd6" args="(ENetPeer *peer, enet_uint32 rtt)" -->
int </td><td class="memItemRight" valign="bottom"><b>enet_peer_throttle</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> rtt)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#gaf082a0ae58d9c435bed75c7325cf7290">enet_peer_send</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> channelID, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Queues a packet to be sent. <a href="#gaf082a0ae58d9c435bed75c7325cf7290"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__ENetPacket.html">ENetPacket</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga6493c7807f5381395305c9c48913a46c">enet_peer_receive</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> *channelID)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to dequeue any incoming queued packet. <a href="#ga6493c7807f5381395305c9c48913a46c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9a8da1e258f10bbef173abd598534f09"></a><!-- doxytag: member="peer::enet_peer_reset_queues" ref="ga9a8da1e258f10bbef173abd598534f09" args="(ENetPeer *peer)" -->
void </td><td class="memItemRight" valign="bottom"><b>enet_peer_reset_queues</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga9444dfff9574a7d21dbbdd34385a7d4d">enet_peer_reset</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Forcefully disconnects a peer. <a href="#ga9444dfff9574a7d21dbbdd34385a7d4d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga5c0708ddaf340aa42e7754a91ce456b6">enet_peer_ping</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a ping request to a peer. <a href="#ga5c0708ddaf340aa42e7754a91ce456b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga636cc45f52461b567d6daffe4ab8f4e9">enet_peer_disconnect_now</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Force an immediate disconnection from a peer. <a href="#ga636cc45f52461b567d6daffe4ab8f4e9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga0e807704b6ecace5004c2cdcfbf813c2">enet_peer_disconnect</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Request a disconnection from a peer. <a href="#ga0e807704b6ecace5004c2cdcfbf813c2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#ga759270d8cccec70f76274e93b49e5ac5">enet_peer_disconnect_later</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Request a disconnection from a peer, but only after all queued outgoing packets are sent. <a href="#ga759270d8cccec70f76274e93b49e5ac5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6f8ab6421d3455b7b12b14f477ea83aa"></a><!-- doxytag: member="peer::enet_peer_queue_acknowledgement" ref="ga6f8ab6421d3455b7b12b14f477ea83aa" args="(ENetPeer *peer, const ENetProtocol *command, enet_uint16 sentTime)" -->
<a class="el" href="struct__ENetAcknowledgement.html">ENetAcknowledgement</a> * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_acknowledgement</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const <a class="el" href="union__ENetProtocol.html">ENetProtocol</a> *command, <a class="el" href="types_8h.html#a245102585fdf31bdf208639ef47bec5d">enet_uint16</a> sentTime)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga67b9b1aceaffe1efe08c9a62de2a9be6"></a><!-- doxytag: member="peer::enet_peer_setup_outgoing_command" ref="ga67b9b1aceaffe1efe08c9a62de2a9be6" args="(ENetPeer *peer, ENetOutgoingCommand *outgoingCommand)" -->
void </td><td class="memItemRight" valign="bottom"><b>enet_peer_setup_outgoing_command</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="struct__ENetOutgoingCommand.html">ENetOutgoingCommand</a> *outgoingCommand)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0dff073e7882de81bdf46ae8e1bc3883"></a><!-- doxytag: member="peer::enet_peer_queue_outgoing_command" ref="ga0dff073e7882de81bdf46ae8e1bc3883" args="(ENetPeer *peer, const ENetProtocol *command, ENetPacket *packet, enet_uint32 offset, enet_uint16 length)" -->
<a class="el" href="struct__ENetOutgoingCommand.html">ENetOutgoingCommand</a> * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_outgoing_command</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const <a class="el" href="union__ENetProtocol.html">ENetProtocol</a> *command, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> offset, <a class="el" href="types_8h.html#a245102585fdf31bdf208639ef47bec5d">enet_uint16</a> length)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9e5635d76d32276d211d655d6570bfd5"></a><!-- doxytag: member="peer::enet_peer_dispatch_incoming_unreliable_commands" ref="ga9e5635d76d32276d211d655d6570bfd5" args="(ENetPeer *peer, ENetChannel *channel)" -->
void </td><td class="memItemRight" valign="bottom"><b>enet_peer_dispatch_incoming_unreliable_commands</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="struct__ENetChannel.html">ENetChannel</a> *channel)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8b260c7d620fa30772db1426daf15ad0"></a><!-- doxytag: member="peer::enet_peer_dispatch_incoming_reliable_commands" ref="ga8b260c7d620fa30772db1426daf15ad0" args="(ENetPeer *peer, ENetChannel *channel)" -->
void </td><td class="memItemRight" valign="bottom"><b>enet_peer_dispatch_incoming_reliable_commands</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="struct__ENetChannel.html">ENetChannel</a> *channel)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad48f786cc1fa1b2453a1da9274c7427b"></a><!-- doxytag: member="peer::enet_peer_queue_incoming_command" ref="gad48f786cc1fa1b2453a1da9274c7427b" args="(ENetPeer *peer, const ENetProtocol *command, ENetPacket *packet, enet_uint32 fragmentCount)" -->
<a class="el" href="struct__ENetIncomingCommand.html">ENetIncomingCommand</a> * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_incoming_command</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const <a class="el" href="union__ENetProtocol.html">ENetProtocol</a> *command, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet, <a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> fragmentCount)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga0e807704b6ecace5004c2cdcfbf813c2"></a><!-- doxytag: member="peer.c::enet_peer_disconnect" ref="ga0e807704b6ecace5004c2cdcfbf813c2" args="(ENetPeer *peer, enet_uint32 data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_disconnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>data</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to request a disconnection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr>
</table>
</dd>
</dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>An ENET_EVENT_DISCONNECT event will be generated by <a class="el" href="group__host.html#ga6ba501b3ee576e5578c8e6d1694ebd49" title="Waits for events on the host specified and shuttles packets between the host and its peers...">enet_host_service()</a> once the disconnection is complete. </dd></dl>
<p>References <a class="el" href="group__host.html#gac8f53bcdbd540043f87e7d59048559fa">enet_host_flush()</a>, <a class="el" href="unix_8h.html#a7bbe3d7e47fd45dda29c0e4a94abe131">ENET_HOST_TO_NET_32</a>, and <a class="el" href="group__peer.html#ga9444dfff9574a7d21dbbdd34385a7d4d">enet_peer_reset()</a>.</p>
<p>Referenced by <a class="el" href="group__peer.html#ga759270d8cccec70f76274e93b49e5ac5">enet_peer_disconnect_later()</a>.</p>
</div>
</div>
<a class="anchor" id="ga759270d8cccec70f76274e93b49e5ac5"></a><!-- doxytag: member="peer.c::enet_peer_disconnect_later" ref="ga759270d8cccec70f76274e93b49e5ac5" args="(ENetPeer *peer, enet_uint32 data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_disconnect_later </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>data</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to request a disconnection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr>
</table>
</dd>
</dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>An ENET_EVENT_DISCONNECT event will be generated by <a class="el" href="group__host.html#ga6ba501b3ee576e5578c8e6d1694ebd49" title="Waits for events on the host specified and shuttles packets between the host and its peers...">enet_host_service()</a> once the disconnection is complete. </dd></dl>
<p>References <a class="el" href="group__peer.html#ga0e807704b6ecace5004c2cdcfbf813c2">enet_peer_disconnect()</a>.</p>
</div>
</div>
<a class="anchor" id="ga636cc45f52461b567d6daffe4ab8f4e9"></a><!-- doxytag: member="peer.c::enet_peer_disconnect_now" ref="ga636cc45f52461b567d6daffe4ab8f4e9" args="(ENetPeer *peer, enet_uint32 data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_disconnect_now </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>data</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to disconnect </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr>
</table>
</dd>
</dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>No ENET_EVENT_DISCONNECT event will be generated. The foreign peer is not guarenteed to receive the disconnect notification, and is reset immediately upon return from this function. </dd></dl>
<p>References <a class="el" href="group__host.html#gac8f53bcdbd540043f87e7d59048559fa">enet_host_flush()</a>, <a class="el" href="unix_8h.html#a7bbe3d7e47fd45dda29c0e4a94abe131">ENET_HOST_TO_NET_32</a>, and <a class="el" href="group__peer.html#ga9444dfff9574a7d21dbbdd34385a7d4d">enet_peer_reset()</a>.</p>
</div>
</div>
<a class="anchor" id="ga5c0708ddaf340aa42e7754a91ce456b6"></a><!-- doxytag: member="peer.c::enet_peer_ping" ref="ga5c0708ddaf340aa42e7754a91ce456b6" args="(ENetPeer *peer)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_ping </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>destination for the ping request </td></tr>
</table>
</dd>
</dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>ping requests factor into the mean round trip time as designated by the roundTripTime field in the ENetPeer structure. Enet automatically pings all connected peers at regular intervals, however, this function may be called to ensure more frequent ping requests. </dd></dl>
</div>
</div>
<a class="anchor" id="ga6493c7807f5381395305c9c48913a46c"></a><!-- doxytag: member="peer.c::enet_peer_receive" ref="ga6493c7807f5381395305c9c48913a46c" args="(ENetPeer *peer, enet_uint8 *channelID)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct__ENetPacket.html">ENetPacket</a>* enet_peer_receive </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> * </td>
<td class="paramname"> <em>channelID</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to dequeue packets from </td></tr>
<tr><td valign="top"></td><td valign="top"><em>channelID</em> </td><td>holds the channel ID of the channel the packet was received on success </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the packet, or NULL if there are no available incoming queued packets </dd></dl>
</div>
</div>
<a class="anchor" id="ga9444dfff9574a7d21dbbdd34385a7d4d"></a><!-- doxytag: member="peer.c::enet_peer_reset" ref="ga9444dfff9574a7d21dbbdd34385a7d4d" args="(ENetPeer *peer)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_reset </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to forcefully disconnect </td></tr>
</table>
</dd>
</dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>The foreign host represented by the peer is not notified of the disconnection and will timeout on its connection to the local host. </dd></dl>
<p>Referenced by <a class="el" href="group__host.html#ga5567a95d7a45521dc9cba93a9066c940">enet_host_create()</a>, <a class="el" href="group__host.html#gacec1e9a0b528c1f9ce30544d2d5b5b79">enet_host_destroy()</a>, <a class="el" href="group__peer.html#ga0e807704b6ecace5004c2cdcfbf813c2">enet_peer_disconnect()</a>, and <a class="el" href="group__peer.html#ga636cc45f52461b567d6daffe4ab8f4e9">enet_peer_disconnect_now()</a>.</p>
</div>
</div>
<a class="anchor" id="gaf082a0ae58d9c435bed75c7325cf7290"></a><!-- doxytag: member="peer.c::enet_peer_send" ref="gaf082a0ae58d9c435bed75c7325cf7290" args="(ENetPeer *peer, enet_uint8 channelID, ENetPacket *packet)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int enet_peer_send </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> </td>
<td class="paramname"> <em>channelID</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct__ENetPacket.html">ENetPacket</a> * </td>
<td class="paramname"> <em>packet</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>destination for the packet </td></tr>
<tr><td valign="top"></td><td valign="top"><em>channelID</em> </td><td>channel on which to send </td></tr>
<tr><td valign="top"></td><td valign="top"><em>packet</em> </td><td>packet to send </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success </td></tr>
<tr><td valign="top"></td><td valign="top"><em><</em> </td><td>0 on failure </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="unix_8h.html#a4ede48cf4612d407ac6b6f064e3117bc">ENET_HOST_TO_NET_16</a>, <a class="el" href="unix_8h.html#a7bbe3d7e47fd45dda29c0e4a94abe131">ENET_HOST_TO_NET_32</a>, <a class="el" href="unix_8h.html#a6fdfe9a0019e06da5931f10263f14d59">ENET_NET_TO_HOST_32</a>, <a class="el" href="enet_8h.html#a9d1fc0ce6da0a057f18bd8b9c762003daab20e7088245ab2ddb7f11dcc9433738">ENET_PACKET_FLAG_RELIABLE</a>, <a class="el" href="enet_8h.html#a9d1fc0ce6da0a057f18bd8b9c762003da7f79cd86eacd2543d6cde2eeccea995e">ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT</a>, and <a class="el" href="enet_8h.html#a9d1fc0ce6da0a057f18bd8b9c762003dad230cc769ef9cc4c7c582b28f9c443fe">ENET_PACKET_FLAG_UNSEQUENCED</a>.</p>
<p>Referenced by <a class="el" href="group__host.html#ga5190a63f78eb0c15bd96cda44bf423c6">enet_host_broadcast()</a>.</p>
</div>
</div>
<a class="anchor" id="gab35807c848b6c88af12ce8476dffbc84"></a><!-- doxytag: member="peer.c::enet_peer_throttle_configure" ref="gab35807c848b6c88af12ce8476dffbc84" args="(ENetPeer *peer, enet_uint32 interval, enet_uint32 acceleration, enet_uint32 deceleration)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enet_peer_throttle_configure </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td>
<td class="paramname"> <em>peer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>interval</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>acceleration</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td>
<td class="paramname"> <em>deceleration</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unreliable packets are dropped by ENet in response to the varying conditions of the Internet connection to the peer. The throttle represents a probability that an unreliable packet should not be dropped and thus sent by ENet to the peer. The lowest mean round trip time from the sending of a reliable packet to the receipt of its acknowledgement is measured over an amount of time specified by the interval parameter in milliseconds. If a measured round trip time happens to be significantly less than the mean round trip time measured over the interval, then the throttle probability is increased to allow more traffic by an amount specified in the acceleration parameter, which is a ratio to the ENET_PEER_PACKET_THROTTLE_SCALE constant. If a measured round trip time happens to be significantly greater than the mean round trip time measured over the interval, then the throttle probability is decreased to limit traffic by an amount specified in the deceleration parameter, which is a ratio to the ENET_PEER_PACKET_THROTTLE_SCALE constant. When the throttle has a value of ENET_PEER_PACKET_THROTTLE_SCALE, on unreliable packets are dropped by ENet, and so 100% of all unreliable packets will be sent. When the throttle has a value of 0, all unreliable packets are dropped by ENet, and so 0% of all unreliable packets will be sent. Intermediate values for the throttle represent intermediate probabilities between 0% and 100% of unreliable packets being sent. The bandwidth limits of the local and foreign hosts are taken into account to determine a sensible limit for the throttle probability above which it should not raise even in the best of conditions.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to configure </td></tr>
<tr><td valign="top"></td><td valign="top"><em>interval</em> </td><td>interval, in milliseconds, over which to measure lowest mean RTT; the default value is ENET_PEER_PACKET_THROTTLE_INTERVAL. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>acceleration</em> </td><td>rate at which to increase the throttle probability as mean RTT declines </td></tr>
<tr><td valign="top"></td><td valign="top"><em>deceleration</em> </td><td>rate at which to decrease the throttle probability as mean RTT increases </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="unix_8h.html#a7bbe3d7e47fd45dda29c0e4a94abe131">ENET_HOST_TO_NET_32</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue May 31 2011 03:26:47 for enet by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
|