JSR-356 - Handling ClientContainer.setMax(Text|Binary)MessageBufferSize better

+ The Jetty API is more configurable than the JSR, this forces the
   Jetty side API to be consistent for whatever value the end user
   specifies.
This commit is contained in:
Joakim Erdfelt 2013-07-15 10:42:17 -07:00
parent b3aee8e4d5
commit 2362a4e8b3
1 changed files with 3 additions and 2 deletions

View File

@ -282,13 +282,14 @@ public class ClientContainer implements WebSocketContainer
@Override
public void setAsyncSendTimeout(long timeoutmillis)
{
client.setMaxIdleTimeout(timeoutmillis);
client.setAsyncWriteTimeout(timeoutmillis);
}
@Override
public void setDefaultMaxBinaryMessageBufferSize(int max)
{
// TODO: add safety net for policy assertions
client.getPolicy().setMaxBinaryMessageSize(max);
client.setMaxBinaryMessageBufferSize(max);
}
@ -301,7 +302,7 @@ public class ClientContainer implements WebSocketContainer
@Override
public void setDefaultMaxTextMessageBufferSize(int max)
{
// TODO: add safety net for policy assertions
client.getPolicy().setMaxTextMessageSize(max);
client.setMaxTextMessageBufferSize(max);
}