Skip to content

Commit

Permalink
Address ws session id conversion to use as a hash code
Browse files Browse the repository at this point in the history
  • Loading branch information
mondain committed Jul 28, 2022
1 parent 855c331 commit 9a2097e
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,36 @@ public WebSocketConnection(WebSocketScope scope, Session session) {
this.scope = scope;
// set our path
path = scope.getPath();
log.debug("path: {}", path);
if (isDebug) {
log.debug("path: {}", path);
}
// cast ws session
this.wsSession = (WsSession) session;
if (isDebug) {
log.debug("ws session: {}", wsSession);
}
// the websocket session id will be used for hash code comparison, its the only usable value currently
wsSessionId = wsSession.getId();
hashCode = Integer.valueOf(wsSessionId);
log.info("wsSessionId: {}", wsSessionId);
if (isDebug) {
log.debug("wsSessionId: {}", wsSessionId);
}
hashCode = wsSessionId.hashCode();
log.info("ws id: {} hashCode: {}", wsSessionId, hashCode);
// get extensions
List<Extension> extList = wsSession.getNegotiatedExtensions();
if (extList != null) {
extList.forEach(extension -> {
extensions.put(extension.getName(), extension);
});
}
log.debug("extensions: {}", extensions);
if (isDebug) {
log.debug("extensions: {}", extensions);
}
// get querystring
String queryString = wsSession.getQueryString();
log.debug("queryString: {}", queryString);
if (isDebug) {
log.debug("queryString: {}", queryString);
}
if (StringUtils.isNotBlank(queryString)) {
// bust it up by ampersand
String[] qsParams = queryString.split("&");
Expand Down

0 comments on commit 9a2097e

Please sign in to comment.