Skip to content

Commit

Permalink
Issue #201 - WebSocketMessageSenderDefault.sendTo() fails when no Wic…
Browse files Browse the repository at this point in the history
…ket application is bound to the current thread

- Use the application passed to the constructor instead of the thread-bound application
  • Loading branch information
reckart committed Oct 1, 2023
1 parent d5fbbda commit a705bda
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ public void sendToAll(IWebSocketPushMessage event) {
}
}

public void sendTo(Object identifier, IWebSocketPushMessage event) {
@Override
public void sendTo(Object identifier, IWebSocketPushMessage event) {
if(identifier == null) {
return;
}
Application application = Application.get();

WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
IWebSocketConnectionRegistry connectionRegistry = webSocketSettings.getConnectionRegistry();
wicketSessionResolver.resolve(identifier).forEach(sessionId -> {
Expand All @@ -49,5 +50,4 @@ public void sendTo(Object identifier, IWebSocketPushMessage event) {
}
});
}

}

0 comments on commit a705bda

Please sign in to comment.