Closed GitOlli closed 2 years ago
enet_host_create
, make sure to pass in a high enough peerCount
to allow for multiple connections.enet_host_connect
to connect the host to multiple foreign hosts, creating multiple peers. enet_host_service
, otherwise it can't initiate the connections.Do i need to have different ENetAddresses for each peer?
Do i need to have different ENetAddresses for each peer?
No, that struct is only used by enet_host_connect
during its call, and can be reused for another call afterwards. Normally you'd allocate it on the stack.
Though, you would change its host
and/or port
members for each call, right? Otherwise you're connecting to the same foreign host each time.
Hello! I'm making a game with ENet and sfml. I have been testing around with ENet and i was wondering what is the correct way to connect multiple peers from a single ENet client? I have tried many different configurations but the peers don't seem to connect. I didn't find anything related to this.