[ENet-discuss] Not sure what's happening with larger packet

Tim Stowell stowellt at gmail.com
Thu Jun 19 12:57:22 PDT 2008


Just a heads up and answer for others who might run into this. The problem
was I was creating my packet with the ENET_PACKET_FLAG_NO_ALLOCATE flag.
Normally this was fine, but in the case of the large packet ENet had to
split it into 335 pieces, and so while the first 22 or so got sent fine,
after that the pointer I passed into the enet_packet_create call became
invalid (because the memory got destroyed in my calling function) and the
later fragments had invalid memory to write from, which prevented them from
being sent at all. To solve it I just removed the
ENET_PACKET_FLAG_NO_ALLOCATE

On Wed, Jun 18, 2008 at 5:03 PM, Tim Stowell <stowellt at gmail.com> wrote:

> Hi,
>
> Thanks for this library, I've just integrated ENet into my application, and
> all has been working great except for when I try to send a larger packet. I
> have a client host and server host (both on the same machine for testing)
> and the client is successfully connected to the server. When the server
> tries to send a packet with data amounting to around 457 k bytes to the
> client peer, the client never seems to get the packet, and after about 10
> seconds or so the server actually gets a ENET_EVENT_TYPE_DISCONNECT event,
> even though I never send that from the client. Do I need to do anything
> different with larger packets? I know ENet says it will transparently handle
> splitting of larger packets so I'm not sure what is happening. Thanks for
> any help.
>
> -Tim
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20080619/6aae89ff/attachment.htm>


More information about the ENet-discuss mailing list