ASF Bugzilla – Attachment 31060 Details for
Bug 55799
[websocket] Stability issues when concurrently sending large messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated Test case (modifications to the Chat example)
Chat_TestCase2.patch (text/plain), 2.19 KB, created by
Konstantin Preißer
on 2013-11-20 14:48:16 UTC
(
hide
)
Description:
Updated Test case (modifications to the Chat example)
Filename:
MIME Type:
Creator:
Konstantin Preißer
Created:
2013-11-20 14:48:16 UTC
Size:
2.19 KB
patch
obsolete
>Index: examples/WEB-INF/classes/websocket/chat/ChatAnnotation.java >=================================================================== >--- examples/WEB-INF/classes/websocket/chat/ChatAnnotation.java (revision 1543818) >+++ examples/WEB-INF/classes/websocket/chat/ChatAnnotation.java (working copy) >@@ -74,6 +74,10 @@ > // Never trust the client > String filteredMessage = String.format("%s: %s", > nickname, HTMLFilter.filter(message.toString())); >+ >+ for (int i = 0; i < 8; i++) { >+ filteredMessage = filteredMessage + filteredMessage; >+ } > broadcast(filteredMessage); > } > >@@ -92,17 +96,8 @@ > synchronized (client) { > client.session.getBasicRemote().sendText(msg); > } >- } catch (IOException e) { >+ } catch (Exception e) { > log.debug("Chat Error: Failed to send message to client", e); >- connections.remove(client); >- try { >- client.session.close(); >- } catch (IOException e1) { >- // Ignore >- } >- String message = String.format("* %s %s", >- client.nickname, "has been disconnected."); >- broadcast(message); > } > } > } >Index: examples/websocket/chat.xhtml >=================================================================== >--- examples/websocket/chat.xhtml (revision 1543818) >+++ examples/websocket/chat.xhtml (working copy) >@@ -74,7 +74,7 @@ > }; > > Chat.socket.onmessage = function (message) { >- Console.log(message.data); >+ //Console.log("Received: " + message.data.length); > }; > }); > >@@ -117,6 +117,12 @@ > for (var i = 0; i < noscripts.length; i++) { > noscripts[i].parentNode.removeChild(noscripts[i]); > } >+ >+ window.setInterval(function() { >+ if (Chat.socket.readyState == 1) { >+ Chat.socket.send("klajsdlaskjdlajsdhouhwo8ahsdoajsodjaso doasijdoiajs odij asoijd oöasijo ödiasj öodisajoöasiöjd asoaidjasoidjaklsdjlask jsd"); >+ } >+ }, 50); > }, false); > > ]]></script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55799
:
31055
|
31056
|
31057
| 31060 |
31078