Connecting python to D on socket of localhost : target machine actively refuses connection

Sergei Degtiarev sdegtiarev at yahoo.com
Sat Sep 23 22:43:55 UTC 2017


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.


More information about the Digitalmars-d-learn mailing list