continue;
}
- char buf[4096];
int ret;
do {
- ret = recv(sock, buf, sizeof(buf), 0);
+ ret = recv(sock, packet_buf, sizeof(packet_buf), 0);
} while (ret == -1 && errno == EINTR);
if (ret <= 0) {
}
for (size_t i = 0; i < stream_indices.size(); ++i) {
- servers->add_data(stream_indices[i], buf, ret);
+ servers->add_data(stream_indices[i], packet_buf, ret);
}
}
}
// The socket we are receiving on (or -1).
int sock;
+
+ // Temporary buffer, sized for the maximum size of an UDP packet.
+ char packet_buf[65536];
};
#endif // !defined(_UDPINPUT_H)