Hi, On Sat, Mar 21, 2015 at 7:58 AM, William Ferguson <[email protected]> wrote: > > More a query than anything else. > > I am using Jetty-9.2.3 to co-ordinate a bit over a dozen mobile devices on a > local wi-fi network using WebSockets. > I have wrapped the WebSockets in a ReliableSender so that if the client > doesn't acknowledge a message within 500ms the server sends it again until it > times out after 5 retries. > > Most of the time it works OK, but I am seeing instances where the server > sends a message to a client, doesn't get an ACK, so resends, and keeps > resending every 500ms (times as recorded by the logging in the code shown > below) until it times out after 2.5 seconds. But looking at the client log > the client receives the first message more than 2.5 seconds after the server > claims to have sent it. And then the client receives all the resends within > the next 50ms. So it appears that the messages may have been batched. >
Another option is that the client does not read them fast enough so that the TCP connection is congested. In that case, the WriteCallback won't be called until the TCP connection is decongested. Normal sequence of events: * sendString() * writeSuccess() * start timer task waiting for client ack * receive client ack * cancel timer task You must start the timer task only if writeSuccess() is called. If it's not called, your TCP connection is congested, and there is no point in starting the timer task. -- Simone Bordet ---- http://cometd.org http://webtide.com http://intalio.com Developer advice, training, services and support from the Jetty & CometD experts. Intalio, the modern way to build business applications. _______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
