Re: Connecting python to D on socket of localhost : target machine actively refuses connection
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.
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
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
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
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
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
On Friday, 22 September 2017 at 05:43:24 UTC, Nicholas Wilson wrote: On Friday, 22 September 2017 at 04:37:44 UTC, Enjoys Math wrote: On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote: I've tried opening the port for TCP with windows 10 firewall settings. Same result. What tool would best help me debug this? Wireshark or is that too low level? I've used Hercules: http://www.hw-group.com/products/hercules/index_en.html I set up a TCP server with it, and it got the message sent from python. Therefore there is something wrong with the D server. Could it be that you need to call `super(&run);` at the end of your constructor, after your data initialisation? Nope, the run() method gets called.
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
On Friday, 22 September 2017 at 04:37:44 UTC, Enjoys Math wrote: On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote: I've tried opening the port for TCP with windows 10 firewall settings. Same result. What tool would best help me debug this? Wireshark or is that too low level? I've used Hercules: http://www.hw-group.com/products/hercules/index_en.html I set up a TCP server with it, and it got the message sent from python. Therefore there is something wrong with the D server. Could it be that you need to call `super(&run);` at the end of your constructor, after your data initialisation?
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote: I've tried opening the port for TCP with windows 10 firewall settings. Same result. What tool would best help me debug this? Wireshark or is that too low level? I've used Hercules: http://www.hw-group.com/products/hercules/index_en.html I set up a TCP server with it, and it got the message sent from python. Therefore there is something wrong with the D server.
Re: Connecting python to D on socket of localhost : target machine actively refuses connection
I've tried opening the port for TCP with windows 10 firewall settings. Same result. What tool would best help me debug this? Wireshark or is that too low level?