RFR: 7198: add websocket server that pushes data on selection updates [v6]

Brice Dutheil github.com+803621+bric3 at openjdk.java.net
Fri Sep 17 07:37:54 UTC 2021


On Thu, 16 Sep 2021 21:09:53 GMT, Alex Ciminian <github.com+348973+cimi at openjdk.org> wrote:

>> application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/websocket/WebsocketServer.java line 23:
>> 
>>> 21: 
>>> 22: public class WebsocketServer {
>>> 23: 	private static int PORT = 8029;
>> 
>> I think the port should be configurable.
>
> This is done now - instead of a checkbox to enable the server, users need to pick a port number with `0` being the default value. When `0` is selected the webserver is disabled.
> 
> We had a discussion about this and @jpbempel pointed out that 0 is a valid port number that means the operating system should pick an open port. Since we don't display the port number in the UI anywhere, binding to a random port will be confusing for the user because they won't know what to connect to ��  So I think it's ok to keep `0` as the disabled value, what do you think?

In general I think it's ok to allow automatic port binding as long as this information is being sent back to the user. But for this use case it's not critical, so using zero to disable the server is OK for me. And if this prove to be too much misleading this can be changed without too much effort.

-------------

PR: https://git.openjdk.java.net/jmc/pull/306


More information about the jmc-dev mailing list