<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hi Stuart,</div>
Yes, indeed. I can reproduce this all the time.
<div class=""><br class="">
</div>
<div class="">Here is a snippet from the wildfly console log -</div>
<div class=""><br class="">
</div>
<div class="">==== WILDFLY STARTUP ====</div>
<div class="">
<div class=""><font face="Courier New" class="">13:01:55,848 INFO &nbsp;[io.undertow.websockets.jsr] (MSC service thread 1-1) UT026003: Adding annotated server endpoint class com.NetworkArt.SVCentral.web.server.ws.agent.am.AMChannel for path /channel/am</font></div>
<div class=""><br class="">
</div>
<div class="">
<div class="">==== ON STARTING REMOTE WEBSOCKET CLIENT ====</div>
<div class=""><font face="Courier New" class="">13:02:39,512 WARN &nbsp;[AMChannel] (default task-3) msgRx(session-id: WhXpPiKFnU0l1rAUXkWExfVc) AUTH_REQ received in an unknown session, discarding</font></div>
<div class=""><font face="Courier New" class="">13:02:39,513 INFO &nbsp;[AMChannel] (default task-3) forceClose(session-id: WhXpPiKFnU0l1rAUXkWExfVc)&nbsp;</font></div>
<div class=""><font face="Courier New" class="">13:02:39,883 INFO &nbsp;[AMChannel] (default task-2) [acme] open( session-id: WhXpPiKFnU0l1rAUXkWExfVc) Added session</font></div>
<div class=""><font face="Courier New" class="">13:02:39,884 INFO &nbsp;[AMChannel] (default task-2) [acme] close(session-id: WhXpPiKFnU0l1rAUXkWExfVc)&nbsp;</font></div>
<div class=""><br class="">
</div>
<div class="">AMChannel is the annotated server endpoint, with open() and msgRx() as the onOpen and onMessage handlers respectively.</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; color: rgb(3, 38, 204);" class=""><font face="Monaco" class=""><span style="color: rgb(119, 119, 119);" class="">@ServerEndpoint</span><span style="color: rgb(0, 0, 0);" class="">(value = SVUrls.</span>SVURL_FRAG_WS_CHANNEL_AM<span style="color: rgb(0, 0, 0);" class="">,</span></font></div>
<div style="margin: 0px; font-size: 11px;" class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; configurator = WsConfigurator.<span style="color: #931a68" class="">class</span>,</font></div>
<div style="margin: 0px; font-size: 11px;" class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; encoders = {AMMsgEncoder.<span style="color: #931a68" class="">class</span>},</font></div>
<div style="margin: 0px; font-size: 11px;" class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; decoders = {AMMsgDecoder.<span style="color: #931a68" class="">class</span>})</font></div>
<div style="margin: 0px; font-size: 11px;" class=""><font face="Monaco" class=""><span style="color: #931a68" class="">public</span>
<span style="color: #931a68" class="">class</span> AMChannel {</font></div>
</div>
<div style="margin: 0px;" class=""><font face="Monaco" class=""><span style="font-size: 11px;" class="">...</span></font></div>
<div style="margin: 0px; font-size: 11px;" class=""><font face="Monaco" class="">}</font></div>
<div class=""><br class="">
</div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">WsConfigurator allows me to extract the host part of the FQDN in the connection url.
<a href="http://acme.networkart.com" class="">acme.networkart.com</a>&nbsp;would be the FQDN and WsConfigurator allows me to extract&nbsp;“acme” and put in the EndpointConfig userProperties.</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">AMMsgEncoder and AMMsgDecoder help in converting to an OutputStream and InputStream respectively.</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class=""><br class="">
</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">session-id is the value retrieved from&nbsp;</span>javax.websocket.Session getId().</div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class=""><br class="">
</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">AUTH_REQ is a message sent by the remote client post a successful connection with AMChannel.</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class=""><br class="">
</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">forceClose() is a method in AMChannel that forces a session close. In the above snippet, as you see I am forcing a session close() since AMChannel hadn’t been called with
 open() earlier (which would be the point at which I would have recorded the session).</span></div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class=""><br class="">
</span></div>
<div class="">The remote client retries every 5 seconds post failure conditions. As I said earlier, some retries are again unsuccessful for the same reason, and sometimes they succeed.</div>
<div class=""><br class="">
</div>
<div class="">I could put a workaround in the client to sleep for sometime before sending the first message to AMChannel, but I would like to see if the above issue can be solved before I do that.</div>
<div class=""><br class="">
</div>
<div class="">Please let me know if you require any other information.</div>
<div class=""><br class="">
</div>
<div class=""><span style="orphans: 2; text-align: -webkit-auto; widows: 2;" class="">Thanks and Best Regards,</span></div>
<div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="margin: 0px; font-size: 12px; " class="">
<div apple-content-edited="true" style=" " class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="margin: 0px; font-size: 12px; " class="">GPN</div>
<div style="margin: 0px; font-size: 12px; " class=""><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<blockquote type="cite" class="">
<div class="">On 05-Jun-2015, at 11:12 am, Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com" class="">sdouglas@redhat.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Do you have a way to reproduce this?<br class="">
<br class="">
Stuart<br class="">
<br class="">
Guruprasad Nagaraj wrote:<br class="">
<blockquote type="cite" class="">Wildfly version: 8.2.0.Final<br class="">
Undertow version: 1.1.0.Final<br class="">
<br class="">
Hi,<br class="">
I am using Undertow web sockets.<br class="">
A remote client (nopoll c client) attempts to open a websocket session;<br class="">
the session is opened and the client immediately sends a message.<br class="">
However, at the ServerEndpoint, the onMessage handler is called prior to<br class="">
the onOpen handler.<br class="">
My server side implementation rejects messages received prior to open<br class="">
and even forces a session close.<br class="">
The client retries the session, and sometimes it is successful i.e. I do<br class="">
see an open first and then followed by a message by the client.<br class="">
<br class="">
Is this an known issue?<br class="">
Sorry, I couldn’t find a way to search the mailing-list archives.<br class="">
<br class="">
Thanks and Best Regards,<br class="">
GPN<br class="">
<br class="">
_______________________________________________<br class="">
undertow-dev mailing list<br class="">
<a href="mailto:undertow-dev@lists.jboss.org" class="">undertow-dev@lists.jboss.org</a><br class="">
https://lists.jboss.org/mailman/listinfo/undertow-dev<br class="">
</blockquote>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>