From 92ce43e39ceac7816f4f46b97283fe23a0860b50 Mon Sep 17 00:00:00 2001 From: Johan Smolders Date: Thu, 26 Jan 2012 10:06:32 +0100 Subject: [PATCH] LinkedBlockingQueue should not have a length The LinkedBlockingQueue should not have a length. If a message received has more then 10 messages being send back it renders the socket useless. Since the bufferQueue.put() method keeps waiting forever for the queue to shrink. --- src/net/tootallnate/websocket/WebSocket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tootallnate/websocket/WebSocket.java b/src/net/tootallnate/websocket/WebSocket.java index fbee8e57e..7698d6c37 100644 --- a/src/net/tootallnate/websocket/WebSocket.java +++ b/src/net/tootallnate/websocket/WebSocket.java @@ -112,7 +112,7 @@ public WebSocket( WebSocketListener listener , List drafts , SocketChanne private void init( WebSocketListener listener, Draft draft, SocketChannel sockchannel ) { this.sockchannel = sockchannel; - this.bufferQueue = new LinkedBlockingQueue( 10 ); + this.bufferQueue = new LinkedBlockingQueue( ); this.handshakeComplete = false; this.socketBuffer = ByteBuffer.allocate( 65558 ); socketBuffer.flip();