June 23, 2005 Bind to any port and get it after binding. | ||||
---|---|---|---|---|
| ||||
I pass InternetAddress.PORT_ANY to Socket.bind. How can I figure out on which port socket is listening.
--
Dawid Ciężarkiewicz | arael
|
June 23, 2005 Re: Bind to any port and get it after binding. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dawid Ciężarkiewicz | On Thu, 23 Jun 2005 23:41:59 +0200, Dawid Ciężarkiewicz <arael@fov.pl> wrote:
> I pass InternetAddress.PORT_ANY to Socket.bind. How can I figure out on
> which port socket is listening.
Try the "localAddress()" method, it returns an Address (or rather an InternetAddress) which has a "port()" method.
Regan
|
Copyright © 1999-2021 by the D Language Foundation