[undertow-dev] Different Session Ids

Stuart Douglas sdouglas at redhat.com
Wed Oct 7 07:27:58 EDT 2015


I'm really not clear what you are doing here? Are you expecting that Session.getId() on the server side to have some specific meaning?

>From the Javadoc:

"
Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the web socket implementation and is implementation dependent."


Stuart

----- Original Message -----
> From: "Dennis Gesker" <dennis at gesker.com>
> To: undertow-dev at lists.jboss.org
> Sent: Tuesday, 6 October, 2015 9:15:05 PM
> Subject: [undertow-dev] Different Session Ids
> 
> Hello List:
> 
> I'm trying to use a websocket in Wildfly 10.0.0.CR2 from a Java SE client.
> 
> It's a pretty basic socket (a little more than just an echo). I'm sending a
> string to the WS on the server. However, the session id logged on WildFly
> and the session id on my Java SE Client do not match .
> 
> 
> 2015-10-06 12:31:28 INFO com.alamon.socket.GetCfgRoleWS - ServerSide >>>
> Connected to ... t9Y2a4kra35JpISc1s8F0qelNhoQ8mB7I_D3vTl4
> 2015-10-06 12:31:28 INFO com.alamon.socket.GetCfgRoleWS - ServerSide >>> got:
> 6 : t9Y2a4kra35JpISc1s8F0qelNhoQ8mB7I_D3vTl4
> 2015-10-06 12:31:29 INFO stdout -
> {"id":6,"name":"inspector","description":"inspector","enabled":true,"created":1444156117341,"modified":1444156117341}
> 2015-10-06 12:31:29 INFO com.alamon.socket.GetCfgRoleWS - ServerSide >>>
> Session t9Y2a4kra35JpISc1s8F0qelNhoQ8mB7I_D3vTl4 closed because of
> CloseReason[1000]
> 
> ClientSide >>> Session 6uT2VhsWOF8Kc5eMboHCybXQ02v1duV9MnhW8KMl closed
> because of CloseReason[1000]
> 
> The value I'm sending to the server (6 as a String) is showing up on the
> server side but I'm not getting a response back. I'm guessing because the
> session id's don't match. But, neither the Java SE client or the Wildfly
> server are throwing any errors.
> 
> The client side seems pretty straight forward:
> websocketServer = " http://localhost:8080/web/getCfgRoleWS ";
> websocketServerURI = new URI(websocketServer);
> webSocketContainer = ContainerProvider.getWebSocketContainer();
> webSocketSession = webSocketContainer.connectToServer(this.getClass(),
> websocketServerURI);
> // And after checking that the webSocketSession is not null or closed:
> webSocketSession.getBasicRemote().sendText(id.toString());
> 
> Environment--
> Client: JDK_1.8.0_60, Undertow 1.3.0.CR2
> Server: JDK_1.8.0_60, Wildfly-10.0.0.CR2
> 
> I would welcome any hints or help that you can offer.
> 
> Cordially,
> Dennis
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list