Skip to content

Conversation

pfirsich
Copy link

If the peer being sent to is not in the "connected" state, enet_peer_send will return -1 and the packet created by read_packet will not be freed.

I stumbled into this bug while I (foolishly) wrote this loop:

for peerIndex = 1, host:peer_count() do
    local peer = host:get_peer(peerIndex)
    if peer ~= event.peer then
        peer:send(event.data, channel, flag)
    end
end

In that way I find the documentation on host:get_peer a little bit confusing: "Returns the connected peer at the specified index", because get_peer may very well return non-"connected" peers. Should the documentation be adjusted as well in that regard?

If the peer being sent to is not in the "connected" state,
enet_peer_send will return -1 and the packet created by read_packet
will not be freed
…o enet2

The renaming is necessary so the new .dll can be imported in löve.
@pfirsich
Copy link
Author

Looking at this a long time after, I notice I did some other dumb stuff in my fork by accident, because I have forgotten this PR. Obviously it should only be this commit: 67f3073 I'm not interested in cleaning that up, but noticed it just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant