On Saturday, 23 September 2017 at 02:50:25 UTC, rikki cattermole
wrote:
On 23/09/2017 3:26 AM, Sergei Degtiarev wrote:
On Friday, 22 September 2017 at 04:06:08 UTC, Enjoys Math
wrote:
Here's my minimal D code (server.d):
public:
this(ushort port, string address="") {
super(& run);
if (address == "")
address = "DESKTOP-T49RGUJ";
this.port = port;
this.address = address;
.........
listener.bind(new InternetAddress(address, port));
It seems to me, you pass invalid address to bind().
InternetAddress takes ipv4 dot notation string x.x.x.x, and
for bind you are to supply INADDR_ANY
For DNS resolution:
https://dlang.org/phobos/std_socket.html#.getAddress
Right, but in this case, it would be sufficient to bind socket to
INADDR_ANY.