futile / enet-rs

High-level bindings for the ENet networking library (http://enet.bespin.org)
Other
39 stars 21 forks source link

Find out what maximum for max_peers is #1

Open futile opened 6 years ago

futile commented 6 years ago

When calling Enet::create_host, the max_peers argument sets the maximum peer count. However, the type of this argument is usize, but probably less than usize::MAX peers are supported. Finding out the maximum count most likely needs to be done by looking into the ENet docs + source. It can then be turned into a specific enum like ChannelLimit etc.

Boscop commented 4 years ago

@futile ENET_PROTOCOL_MAXIMUM_PEER_ID is 0xFFF (4095): https://docs.rs/enet-sys/0.2.0/enet_sys/constant.ENET_PROTOCOL_MAXIMUM_PEER_ID.html http://enet.bespin.org/protocol_8h.html https://github.com/lsalzman/enet/issues/84 See also these threads on increasing the limit: https://github.com/lsalzman/enet/issues/41 http://lists.cubik.org/pipermail/enet-discuss/2014-August/thread.html#2331