Integrated: 8476: Websocket server is tied to JfrEditor
Alex Macdonald
aptmac at openjdk.org
Mon Feb 2 14:19:03 UTC 2026
On Wed, 7 Jan 2026 19:23:18 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:
> This PR addresses JMC-8476, in which the current websocket server implemention ties the server to a JfrEditor page.
>
> At the moment, the Websocket server that is used to send selection data is created from within a JfrEditor page. So every time you open a new recording file, the JfrEditor code tries to start a new websocket server. This is a problem because there is only one field in the JMC settings to set the port number, and it is global to the application. So if I open recording-1, and then use the preferences menu to start the websocket server on port 8029, if I then open up recording-2 it will also try to open a websocket server on port 8029, and fail. As a result, sending data from recording-1 will work, but recording-2 will not (this can be seen in my "before" gif below).
>
> I have extracted the websocket code out into it's own package and made it such that there is one server for the JMC application. So now if you toggle between recordings you can still send data to whatever application you want over websocket.
>
> Before:
> (exception thrown when trying to send events from the second recording)
> 
>
> After:
> (selecting events from multiple recordings now works)
> 
This pull request has now been integrated.
Changeset: f9ba5ef0
Author: Alex Macdonald <aptmac at openjdk.org>
URL: https://git.openjdk.org/jmc/commit/f9ba5ef03796c1c05640c1180e003c6649f2e81a
Stats: 1154 lines in 23 files changed: 739 ins; 393 del; 22 mod
8476: Websocket server is tied to JfrEditor
Reviewed-by: hirt
-------------
PR: https://git.openjdk.org/jmc/pull/698
More information about the jmc-dev
mailing list