-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
Hi! I was wondering if I could get some guidance as to the reason behind slow sends.
long start = System.currentTimeMillis();
socket.send(message);
if (System.currentTimeMillis() - start > 15) {
log.db("Slow send: " + (System.currentTimeMillis() - start));
}
With the code above, I'm usually having no problems, but occasionally the sends will take 100+ms (as opposed to usually taking 2-5ms.
What are possible causes of this? Is it more likely to be the messages being too big? Or is it because of the actual server that this code is running on having network latency problems?
And would it be safe to send using the same socket on separate threads?
Thank you for any help!