<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#c0c0c0" bgcolor="#000000">
if ( enet_host_service( client, &event, 1000 ) > 0 );<br>
if ( event.type == ENET_EVENT_TYPE_RECEIVE );<br>
<br>
Or maybe you have strange semi-colons at the end of your if conditions
that shouldn't be there, thus causing the block beneath to always
executed regardless. :)<br>
<br>
Lee<br>
<br>
On 10/20/2010 06:10 PM, Jay Sprenkle wrote:
<blockquote
cite="mid:AANLkTimQA-xUJQZRumrBaPjTYf07cxaVJLcFWp+FLyX1@mail.gmail.com"
type="cite">Good evening all,<br>
<br>
I'm writing a program using enet and have a question.<br>
The code below occasionally throws an exception because event.packet
isn't allocated.<br>
Is this caused by the sender writing zero length packets?<br>
<br>
while ( s_elapsed < 4 )<br>
{<br>
if ( enet_host_service( client, &event, 1000 ) > 0 );<br>
if ( event.type == ENET_EVENT_TYPE_RECEIVE );<br>
{<br>
if ( event.packet == NULL )<br>
throw std::runtime_error( "null packet on receive
operation" );<br>
...<br>
}<br>
}<br>
<br>
I'm using gcc 4.4.3 on Ubuntu Linux.<br>
<br>
Thanks,<br>
<br>
Jay<br>
<br clear="all">
<br>
-- <br>
---<br>
"Is real reporting dead? News at 11!"<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
ENet-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a>
<a class="moz-txt-link-freetext" href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
</blockquote>
<br>
</body>
</html>