[13] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
| 3 | <title>enet: ENet peer functions</title> |
---|
| 4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 5 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
| 7 | <!-- Generated by Doxygen 1.5.1 --> |
---|
| 8 | <div class="tabs"> |
---|
| 9 | <ul> |
---|
| 10 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
| 11 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
| 12 | <li><a href="classes.html"><span>Data Structures</span></a></li> |
---|
| 13 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 14 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 15 | </ul></div> |
---|
| 16 | <h1>ENet peer functions</h1> |
---|
| 17 | <p> |
---|
| 18 | <table border="0" cellpadding="0" cellspacing="0"> |
---|
| 19 | <tr><td></td></tr> |
---|
| 20 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
---|
| 21 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#gb35807c848b6c88af12ce8476dffbc84">enet_peer_throttle_configure</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> interval, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> acceleration, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> deceleration)</td></tr> |
---|
| 22 | |
---|
| 23 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures throttle parameter for a peer. <a href="#gb35807c848b6c88af12ce8476dffbc84"></a><br></td></tr> |
---|
| 24 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g52c5c6b1bbd807466298b2d7ed12fdd6"></a><!-- doxytag: member="peer::enet_peer_throttle" ref="g52c5c6b1bbd807466298b2d7ed12fdd6" args="(ENetPeer *peer, enet_uint32 rtt)" --> |
---|
| 25 | 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#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> rtt)</td></tr> |
---|
| 26 | |
---|
| 27 | <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#gf082a0ae58d9c435bed75c7325cf7290">enet_peer_send</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> channelID, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet)</td></tr> |
---|
| 28 | |
---|
| 29 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Queues a packet to be sent. <a href="#gf082a0ae58d9c435bed75c7325cf7290"></a><br></td></tr> |
---|
| 30 | <tr><td class="memItemLeft" nowrap 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#g8dc63196f44a3b7a31fd23d8f856d80f">enet_peer_receive</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> channelID)</td></tr> |
---|
| 31 | |
---|
| 32 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to dequeue any incoming queued packet. <a href="#g8dc63196f44a3b7a31fd23d8f856d80f"></a><br></td></tr> |
---|
| 33 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9a8da1e258f10bbef173abd598534f09"></a><!-- doxytag: member="peer::enet_peer_reset_queues" ref="g9a8da1e258f10bbef173abd598534f09" args="(ENetPeer *peer)" --> |
---|
| 34 | 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> |
---|
| 35 | |
---|
| 36 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#g9444dfff9574a7d21dbbdd34385a7d4d">enet_peer_reset</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer)</td></tr> |
---|
| 37 | |
---|
| 38 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Forcefully disconnects a peer. <a href="#g9444dfff9574a7d21dbbdd34385a7d4d"></a><br></td></tr> |
---|
| 39 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#g5c0708ddaf340aa42e7754a91ce456b6">enet_peer_ping</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer)</td></tr> |
---|
| 40 | |
---|
| 41 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a ping request to a peer. <a href="#g5c0708ddaf340aa42e7754a91ce456b6"></a><br></td></tr> |
---|
| 42 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#g636cc45f52461b567d6daffe4ab8f4e9">enet_peer_disconnect_now</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr> |
---|
| 43 | |
---|
| 44 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Force an immediate disconnection from a peer. <a href="#g636cc45f52461b567d6daffe4ab8f4e9"></a><br></td></tr> |
---|
| 45 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#g0e807704b6ecace5004c2cdcfbf813c2">enet_peer_disconnect</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr> |
---|
| 46 | |
---|
| 47 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Request a disconnection from a peer. <a href="#g0e807704b6ecace5004c2cdcfbf813c2"></a><br></td></tr> |
---|
| 48 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__peer.html#g759270d8cccec70f76274e93b49e5ac5">enet_peer_disconnect_later</a> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> data)</td></tr> |
---|
| 49 | |
---|
| 50 | <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="#g759270d8cccec70f76274e93b49e5ac5"></a><br></td></tr> |
---|
| 51 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6f8ab6421d3455b7b12b14f477ea83aa"></a><!-- doxytag: member="peer::enet_peer_queue_acknowledgement" ref="g6f8ab6421d3455b7b12b14f477ea83aa" args="(ENetPeer *peer, const ENetProtocol *command, enet_uint16 sentTime)" --> |
---|
| 52 | ENetAcknowledgement * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_acknowledgement</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const ENetProtocol *command, <a class="el" href="types_8h.html#245102585fdf31bdf208639ef47bec5d">enet_uint16</a> sentTime)</td></tr> |
---|
| 53 | |
---|
| 54 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0dff073e7882de81bdf46ae8e1bc3883"></a><!-- doxytag: member="peer::enet_peer_queue_outgoing_command" ref="g0dff073e7882de81bdf46ae8e1bc3883" args="(ENetPeer *peer, const ENetProtocol *command, ENetPacket *packet, enet_uint32 offset, enet_uint16 length)" --> |
---|
| 55 | ENetOutgoingCommand * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_outgoing_command</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const ENetProtocol *command, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> offset, <a class="el" href="types_8h.html#245102585fdf31bdf208639ef47bec5d">enet_uint16</a> length)</td></tr> |
---|
| 56 | |
---|
| 57 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd48f786cc1fa1b2453a1da9274c7427b"></a><!-- doxytag: member="peer::enet_peer_queue_incoming_command" ref="gd48f786cc1fa1b2453a1da9274c7427b" args="(ENetPeer *peer, const ENetProtocol *command, ENetPacket *packet, enet_uint32 fragmentCount)" --> |
---|
| 58 | ENetIncomingCommand * </td><td class="memItemRight" valign="bottom"><b>enet_peer_queue_incoming_command</b> (<a class="el" href="struct__ENetPeer.html">ENetPeer</a> *peer, const ENetProtocol *command, <a class="el" href="struct__ENetPacket.html">ENetPacket</a> *packet, <a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> fragmentCount)</td></tr> |
---|
| 59 | |
---|
| 60 | </table> |
---|
| 61 | <hr><h2>Function Documentation</h2> |
---|
| 62 | <a class="anchor" name="g0e807704b6ecace5004c2cdcfbf813c2"></a><!-- doxytag: member="peer.c::enet_peer_disconnect" ref="g0e807704b6ecace5004c2cdcfbf813c2" args="(ENetPeer *peer, enet_uint32 data)" --> |
---|
| 63 | <div class="memitem"> |
---|
| 64 | <div class="memproto"> |
---|
| 65 | <table class="memname"> |
---|
| 66 | <tr> |
---|
| 67 | <td class="memname">void enet_peer_disconnect </td> |
---|
| 68 | <td>(</td> |
---|
| 69 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 70 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 71 | </tr> |
---|
| 72 | <tr> |
---|
| 73 | <td class="paramkey"></td> |
---|
| 74 | <td></td> |
---|
| 75 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 76 | <td class="paramname"> <em>data</em></td><td> </td> |
---|
| 77 | </tr> |
---|
| 78 | <tr> |
---|
| 79 | <td></td> |
---|
| 80 | <td>)</td> |
---|
| 81 | <td></td><td></td><td width="100%"></td> |
---|
| 82 | </tr> |
---|
| 83 | </table> |
---|
| 84 | </div> |
---|
| 85 | <div class="memdoc"> |
---|
| 86 | |
---|
| 87 | <p> |
---|
| 88 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 89 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 90 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to request a disconnection </td></tr> |
---|
| 91 | <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr> |
---|
| 92 | </table> |
---|
| 93 | </dl> |
---|
| 94 | <dl class="remark" compact><dt><b>Remarks:</b></dt><dd>An ENET_EVENT_DISCONNECT event will be generated by <a class="el" href="group__host.html#g6ba501b3ee576e5578c8e6d1694ebd49">enet_host_service()</a> once the disconnection is complete. </dd></dl> |
---|
| 95 | |
---|
| 96 | </div> |
---|
| 97 | </div><p> |
---|
| 98 | <a class="anchor" name="g759270d8cccec70f76274e93b49e5ac5"></a><!-- doxytag: member="peer.c::enet_peer_disconnect_later" ref="g759270d8cccec70f76274e93b49e5ac5" args="(ENetPeer *peer, enet_uint32 data)" --> |
---|
| 99 | <div class="memitem"> |
---|
| 100 | <div class="memproto"> |
---|
| 101 | <table class="memname"> |
---|
| 102 | <tr> |
---|
| 103 | <td class="memname">void enet_peer_disconnect_later </td> |
---|
| 104 | <td>(</td> |
---|
| 105 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 106 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 107 | </tr> |
---|
| 108 | <tr> |
---|
| 109 | <td class="paramkey"></td> |
---|
| 110 | <td></td> |
---|
| 111 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 112 | <td class="paramname"> <em>data</em></td><td> </td> |
---|
| 113 | </tr> |
---|
| 114 | <tr> |
---|
| 115 | <td></td> |
---|
| 116 | <td>)</td> |
---|
| 117 | <td></td><td></td><td width="100%"></td> |
---|
| 118 | </tr> |
---|
| 119 | </table> |
---|
| 120 | </div> |
---|
| 121 | <div class="memdoc"> |
---|
| 122 | |
---|
| 123 | <p> |
---|
| 124 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 125 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 126 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to request a disconnection </td></tr> |
---|
| 127 | <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr> |
---|
| 128 | </table> |
---|
| 129 | </dl> |
---|
| 130 | <dl class="remark" compact><dt><b>Remarks:</b></dt><dd>An ENET_EVENT_DISCONNECT event will be generated by <a class="el" href="group__host.html#g6ba501b3ee576e5578c8e6d1694ebd49">enet_host_service()</a> once the disconnection is complete. </dd></dl> |
---|
| 131 | |
---|
| 132 | </div> |
---|
| 133 | </div><p> |
---|
| 134 | <a class="anchor" name="g636cc45f52461b567d6daffe4ab8f4e9"></a><!-- doxytag: member="peer.c::enet_peer_disconnect_now" ref="g636cc45f52461b567d6daffe4ab8f4e9" args="(ENetPeer *peer, enet_uint32 data)" --> |
---|
| 135 | <div class="memitem"> |
---|
| 136 | <div class="memproto"> |
---|
| 137 | <table class="memname"> |
---|
| 138 | <tr> |
---|
| 139 | <td class="memname">void enet_peer_disconnect_now </td> |
---|
| 140 | <td>(</td> |
---|
| 141 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 142 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 143 | </tr> |
---|
| 144 | <tr> |
---|
| 145 | <td class="paramkey"></td> |
---|
| 146 | <td></td> |
---|
| 147 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 148 | <td class="paramname"> <em>data</em></td><td> </td> |
---|
| 149 | </tr> |
---|
| 150 | <tr> |
---|
| 151 | <td></td> |
---|
| 152 | <td>)</td> |
---|
| 153 | <td></td><td></td><td width="100%"></td> |
---|
| 154 | </tr> |
---|
| 155 | </table> |
---|
| 156 | </div> |
---|
| 157 | <div class="memdoc"> |
---|
| 158 | |
---|
| 159 | <p> |
---|
| 160 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 161 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 162 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to disconnect </td></tr> |
---|
| 163 | <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data describing the disconnection </td></tr> |
---|
| 164 | </table> |
---|
| 165 | </dl> |
---|
| 166 | <dl class="remark" compact><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> |
---|
| 167 | |
---|
| 168 | </div> |
---|
| 169 | </div><p> |
---|
| 170 | <a class="anchor" name="g5c0708ddaf340aa42e7754a91ce456b6"></a><!-- doxytag: member="peer.c::enet_peer_ping" ref="g5c0708ddaf340aa42e7754a91ce456b6" args="(ENetPeer *peer)" --> |
---|
| 171 | <div class="memitem"> |
---|
| 172 | <div class="memproto"> |
---|
| 173 | <table class="memname"> |
---|
| 174 | <tr> |
---|
| 175 | <td class="memname">void enet_peer_ping </td> |
---|
| 176 | <td>(</td> |
---|
| 177 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 178 | <td class="paramname"> <em>peer</em> </td> |
---|
| 179 | <td> ) </td> |
---|
| 180 | <td width="100%"></td> |
---|
| 181 | </tr> |
---|
| 182 | </table> |
---|
| 183 | </div> |
---|
| 184 | <div class="memdoc"> |
---|
| 185 | |
---|
| 186 | <p> |
---|
| 187 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 188 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 189 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>destination for the ping request </td></tr> |
---|
| 190 | </table> |
---|
| 191 | </dl> |
---|
| 192 | <dl class="remark" compact><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> |
---|
| 193 | |
---|
| 194 | </div> |
---|
| 195 | </div><p> |
---|
| 196 | <a class="anchor" name="g8dc63196f44a3b7a31fd23d8f856d80f"></a><!-- doxytag: member="peer.c::enet_peer_receive" ref="g8dc63196f44a3b7a31fd23d8f856d80f" args="(ENetPeer *peer, enet_uint8 channelID)" --> |
---|
| 197 | <div class="memitem"> |
---|
| 198 | <div class="memproto"> |
---|
| 199 | <table class="memname"> |
---|
| 200 | <tr> |
---|
| 201 | <td class="memname"><a class="el" href="struct__ENetPacket.html">ENetPacket</a>* enet_peer_receive </td> |
---|
| 202 | <td>(</td> |
---|
| 203 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 204 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 205 | </tr> |
---|
| 206 | <tr> |
---|
| 207 | <td class="paramkey"></td> |
---|
| 208 | <td></td> |
---|
| 209 | <td class="paramtype"><a class="el" href="types_8h.html#34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> </td> |
---|
| 210 | <td class="paramname"> <em>channelID</em></td><td> </td> |
---|
| 211 | </tr> |
---|
| 212 | <tr> |
---|
| 213 | <td></td> |
---|
| 214 | <td>)</td> |
---|
| 215 | <td></td><td></td><td width="100%"></td> |
---|
| 216 | </tr> |
---|
| 217 | </table> |
---|
| 218 | </div> |
---|
| 219 | <div class="memdoc"> |
---|
| 220 | |
---|
| 221 | <p> |
---|
| 222 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 223 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 224 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to dequeue packets from </td></tr> |
---|
| 225 | <tr><td valign="top"></td><td valign="top"><em>channelID</em> </td><td>channel on which to receive </td></tr> |
---|
| 226 | </table> |
---|
| 227 | </dl> |
---|
| 228 | <dl class="return" compact><dt><b>Returns:</b></dt><dd>a pointer to the packet, or NULL if there are no available incoming queued packets </dd></dl> |
---|
| 229 | |
---|
| 230 | </div> |
---|
| 231 | </div><p> |
---|
| 232 | <a class="anchor" name="g9444dfff9574a7d21dbbdd34385a7d4d"></a><!-- doxytag: member="peer.c::enet_peer_reset" ref="g9444dfff9574a7d21dbbdd34385a7d4d" args="(ENetPeer *peer)" --> |
---|
| 233 | <div class="memitem"> |
---|
| 234 | <div class="memproto"> |
---|
| 235 | <table class="memname"> |
---|
| 236 | <tr> |
---|
| 237 | <td class="memname">void enet_peer_reset </td> |
---|
| 238 | <td>(</td> |
---|
| 239 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 240 | <td class="paramname"> <em>peer</em> </td> |
---|
| 241 | <td> ) </td> |
---|
| 242 | <td width="100%"></td> |
---|
| 243 | </tr> |
---|
| 244 | </table> |
---|
| 245 | </div> |
---|
| 246 | <div class="memdoc"> |
---|
| 247 | |
---|
| 248 | <p> |
---|
| 249 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 250 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 251 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to forcefully disconnect </td></tr> |
---|
| 252 | </table> |
---|
| 253 | </dl> |
---|
| 254 | <dl class="remark" compact><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> |
---|
| 255 | |
---|
| 256 | </div> |
---|
| 257 | </div><p> |
---|
| 258 | <a class="anchor" name="gf082a0ae58d9c435bed75c7325cf7290"></a><!-- doxytag: member="peer.c::enet_peer_send" ref="gf082a0ae58d9c435bed75c7325cf7290" args="(ENetPeer *peer, enet_uint8 channelID, ENetPacket *packet)" --> |
---|
| 259 | <div class="memitem"> |
---|
| 260 | <div class="memproto"> |
---|
| 261 | <table class="memname"> |
---|
| 262 | <tr> |
---|
| 263 | <td class="memname">int enet_peer_send </td> |
---|
| 264 | <td>(</td> |
---|
| 265 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 266 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 267 | </tr> |
---|
| 268 | <tr> |
---|
| 269 | <td class="paramkey"></td> |
---|
| 270 | <td></td> |
---|
| 271 | <td class="paramtype"><a class="el" href="types_8h.html#34ce80c65abc6389fe0121a83d757f07">enet_uint8</a> </td> |
---|
| 272 | <td class="paramname"> <em>channelID</em>, </td> |
---|
| 273 | </tr> |
---|
| 274 | <tr> |
---|
| 275 | <td class="paramkey"></td> |
---|
| 276 | <td></td> |
---|
| 277 | <td class="paramtype"><a class="el" href="struct__ENetPacket.html">ENetPacket</a> * </td> |
---|
| 278 | <td class="paramname"> <em>packet</em></td><td> </td> |
---|
| 279 | </tr> |
---|
| 280 | <tr> |
---|
| 281 | <td></td> |
---|
| 282 | <td>)</td> |
---|
| 283 | <td></td><td></td><td width="100%"></td> |
---|
| 284 | </tr> |
---|
| 285 | </table> |
---|
| 286 | </div> |
---|
| 287 | <div class="memdoc"> |
---|
| 288 | |
---|
| 289 | <p> |
---|
| 290 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 291 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 292 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>destination for the packet </td></tr> |
---|
| 293 | <tr><td valign="top"></td><td valign="top"><em>channelID</em> </td><td>channel on which to send </td></tr> |
---|
| 294 | <tr><td valign="top"></td><td valign="top"><em>packet</em> </td><td>packet to send </td></tr> |
---|
| 295 | </table> |
---|
| 296 | </dl> |
---|
| 297 | <dl compact><dt><b>Return values:</b></dt><dd> |
---|
| 298 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 299 | <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success </td></tr> |
---|
| 300 | <tr><td valign="top"></td><td valign="top"><em><</em> </td><td>0 on failure </td></tr> |
---|
| 301 | </table> |
---|
| 302 | </dl> |
---|
| 303 | |
---|
| 304 | </div> |
---|
| 305 | </div><p> |
---|
| 306 | <a class="anchor" name="gb35807c848b6c88af12ce8476dffbc84"></a><!-- doxytag: member="peer.c::enet_peer_throttle_configure" ref="gb35807c848b6c88af12ce8476dffbc84" args="(ENetPeer *peer, enet_uint32 interval, enet_uint32 acceleration, enet_uint32 deceleration)" --> |
---|
| 307 | <div class="memitem"> |
---|
| 308 | <div class="memproto"> |
---|
| 309 | <table class="memname"> |
---|
| 310 | <tr> |
---|
| 311 | <td class="memname">void enet_peer_throttle_configure </td> |
---|
| 312 | <td>(</td> |
---|
| 313 | <td class="paramtype"><a class="el" href="struct__ENetPeer.html">ENetPeer</a> * </td> |
---|
| 314 | <td class="paramname"> <em>peer</em>, </td> |
---|
| 315 | </tr> |
---|
| 316 | <tr> |
---|
| 317 | <td class="paramkey"></td> |
---|
| 318 | <td></td> |
---|
| 319 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 320 | <td class="paramname"> <em>interval</em>, </td> |
---|
| 321 | </tr> |
---|
| 322 | <tr> |
---|
| 323 | <td class="paramkey"></td> |
---|
| 324 | <td></td> |
---|
| 325 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 326 | <td class="paramname"> <em>acceleration</em>, </td> |
---|
| 327 | </tr> |
---|
| 328 | <tr> |
---|
| 329 | <td class="paramkey"></td> |
---|
| 330 | <td></td> |
---|
| 331 | <td class="paramtype"><a class="el" href="types_8h.html#5273659ca3c664b8550452732e9e4ae3">enet_uint32</a> </td> |
---|
| 332 | <td class="paramname"> <em>deceleration</em></td><td> </td> |
---|
| 333 | </tr> |
---|
| 334 | <tr> |
---|
| 335 | <td></td> |
---|
| 336 | <td>)</td> |
---|
| 337 | <td></td><td></td><td width="100%"></td> |
---|
| 338 | </tr> |
---|
| 339 | </table> |
---|
| 340 | </div> |
---|
| 341 | <div class="memdoc"> |
---|
| 342 | |
---|
| 343 | <p> |
---|
| 344 | 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> |
---|
| 345 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 346 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 347 | <tr><td valign="top"></td><td valign="top"><em>peer</em> </td><td>peer to configure </td></tr> |
---|
| 348 | <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> |
---|
| 349 | <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> |
---|
| 350 | <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> |
---|
| 351 | </table> |
---|
| 352 | </dl> |
---|
| 353 | |
---|
| 354 | </div> |
---|
| 355 | </div><p> |
---|
| 356 | <hr size="1"><address style="align: right;"><small>Generated on Wed Jun 6 14:33:50 2007 for enet by |
---|
| 357 | <a href="http://www.doxygen.org/index.html"> |
---|
| 358 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> |
---|
| 359 | </body> |
---|
| 360 | </html> |
---|