Open phemphill opened 10 years ago
I was able to test this today in an environment that did not have SSL/TLS and I was still unable to receive messages larger than 8k or any subsequent messages on that connection. My earlier hunch that SSL/TLS was related seems to be invalid.
@phemphill Thanks. Will try to spend time on it.
Curious if there have been any updates on this issue? I'm having trouble with 8K+ messages without SSL/TLS using wasync 2.1.2 and async-http-client 1.9.20 and WebSocket as the transport (long polling seems to work). Client side I don't see the message event triggering and server-side with Atmosphere 2.3.4 logging set to trace I just see it closing the connection with error code 1006 and read EOF.
If I downgrade to wasync 1.4.0 and async-http-client 1.8.1 per the suggestion here, it appears to work with WebSockets.
@phemphill You need to set [this config]() on the AHC Client
NettyAsyncHttpProviderConfig nettyConfig = new NettyAsyncHttpProviderConfig();
nettyConfig.addProperty("tcpNoDelay", "true");
nettyConfig.addProperty("keepAlive", "true");
nettyConfig.addProperty("reuseAddress", true);
nettyConfig.addProperty("connectTimeoutMillis", nettyConnectionTimeout);
nettyConfig.setWebSocketMaxFrameSize(65536);
Awesome, that works. Thank you.
I'm unable to receive any messages larger than 8k. Any thing larger than 8k doesn't get raised as a message event until another message less than 8k is received. I think the track message size decoder is then failing on that message because the message received (which is encoded in json) is unreadable. I'll add that if I use an old version of async-http-client (1.8.1), it works as expected: the 8k messages are received in completion, the message event is raised, and they are processed correctly. I only tried older versions of this library because the debugger seemed to suggest it was how wAsync was interacting with it that was causing the problem.
A possible influence in this issue is that the transport event fires every time a message is received and multiple times for messages larger than 8k. According to the documentation, this should only fire once when connecting the socket. I'm not sure how much of an issue this is. For me it's really only adding to the logs, but I wondered if it related to the messages larger than 8k failing.
Here are the configuration details: Android 4.1 - 4.4 (I've also seen the problems on the Android 5.0 previews, and a colleague has seen this in a server based java environment). wAsync 1.4.0 netty 3.9.2 async-http-client 1.8.11 (trying 1.8.14 did not help) The connection uses the websockets transport only. The connection uses TLS. I have the runtime setup to use the NettyAsyncHttpProvider as described on the wiki. I'll note that changing the max chunk buffer size doesn't affect the 8k issue. Recombining chunks of any size seems to be a problem. The client is set to track message size.
Below see some unit tests for the situations:
For the multiple transport event fires:
For the large message receiving: Note, I was unable to setup SSL/TLS in this unit test, the test doesn't seem to replicate the issue, and I think that the SSL/TLS part may be important to causing the receiving problem.