Skip to content
Snippets Groups Projects
Commit b961b385 authored by FearlessTobi's avatar FearlessTobi
Browse files

network: Use lower timeout for enet_host_service

This allows us to have a 10x higher throughput of packets by using a much shorter waiting time.
parent d9282696
No related branches found
No related tags found
No related merge requests found
......@@ -234,7 +234,7 @@ public:
void Room::RoomImpl::ServerLoop() {
while (state != State::Closed) {
ENetEvent event;
if (enet_host_service(server, &event, 50) > 0) {
if (enet_host_service(server, &event, 5) > 0) {
switch (event.type) {
case ENET_EVENT_TYPE_RECEIVE:
switch (event.packet->data[0]) {
......
......@@ -159,7 +159,7 @@ void RoomMember::RoomMemberImpl::MemberLoop() {
while (IsConnected()) {
std::lock_guard lock(network_mutex);
ENetEvent event;
if (enet_host_service(client, &event, 100) > 0) {
if (enet_host_service(client, &event, 5) > 0) {
switch (event.type) {
case ENET_EVENT_TYPE_RECEIVE:
switch (event.packet->data[0]) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment