Get effective hsqldb server port
Илья Басин <[email protected]> Wed, 22 Feb 2023 11:10:37 +0400
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <CAAAsc_agaid-pfZAdsTwhouKvU-yn8VvcDqUui0Hg+mMkFksEA@mail.gmail.com> |
--===============6228023563847505032== Content-Type: multipart/alternative; boundary="00000000000077f57305f5449846" --00000000000077f57305f5449846 Content-Type: text/plain; charset="UTF-8" Hi. I want to start the server on an ephemeral port. I call server.setPort(0) and then start(). The server starts, but it does not have a method to return the listening port of the server socket. getPort() returns 0. Only with reflection I was able to get the private field "socket" and get the port. --00000000000077f57305f5449846 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Hi. I want to start the server on an ephemeral port. I ca= ll server.setPort(0) and then start(). The server starts, but it does not h= ave a method to return the listening port of the server socket. getPort() r= eturns 0. Only with reflection I was able to get the private field "so= cket" and get the port.</div> --00000000000077f57305f5449846-- --===============6228023563847505032== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6228023563847505032== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Hsqldb-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-user --===============6228023563847505032==--