Re: Get effective hsqldb server port
Fred Toussi via Hsqldb-user <[email protected]> Wed, 08 Mar 2023 00:28:47 +0000
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0704434593284083779== Content-Type: multipart/alternative; boundary=174d3a91ff954b44bf6cb6c2d845dbaa --174d3a91ff954b44bf6cb6c2d845dbaa Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable This can be useful. A new method, getLocalPort() will be introduced in t= he next release. Release data is not yet known. On Wed, Feb 22, 2023, at 07:10, =D0=98=D0=BB=D1=8C=D1=8F =D0=91=D0=B0=D1= =81=D0=B8=D0=BD wrote: > Hi. I want to start the server on an ephemeral port. I call server.set= Port(0) and then start(). The server starts, but it does not have a meth= od 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. >=20 > _______________________________________________ > Hsqldb-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hsqldb-user >=20 --174d3a91ff954b44bf6cb6c2d845dbaa Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html><html><head><title></title><style type=3D"text/css">p.Mso= Normal,p.MsoNoSpacing{margin:0}</style></head><body><div style=3D"font-f= amily:Arial;">This can be useful. A new method, getLocalPort() will be i= ntroduced in the next release. Release data is not yet known.<br></div><= div style=3D"font-family:Arial;"><br></div><div>On Wed, Feb 22, 2023, at= 07:10, =D0=98=D0=BB=D1=8C=D1=8F =D0=91=D0=B0=D1=81=D0=B8=D0=BD wrote:<b= r></div><blockquote type=3D"cite" id=3D"qt" style=3D""><div dir=3D"auto"= >Hi. I want to start the server on an ephemeral port. I call server.setP= ort(0) and then start(). The server starts, but it does not have a metho= d 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.<br></div><div><br></div><div>_____________________________= __________________<br></div><div>Hsqldb-user mailing list<br></div><div>= <a href=3D"mailto:[email protected]">[email protected]= ourceforge.net</a><br></div><div><a href=3D"https://lists.sourceforge.ne= t/lists/listinfo/hsqldb-user">https://lists.sourceforge.net/lists/listin= fo/hsqldb-user</a><br></div><div><br></div></blockquote><div style=3D"fo= nt-family:Arial;"><br></div></body></html> --174d3a91ff954b44bf6cb6c2d845dbaa-- --===============0704434593284083779== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0704434593284083779== 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 --===============0704434593284083779==--