// // MessageId: WSAENOTSOCK // // MessageText: // // An operation was attempted on something that is not a socket. // #define WSAENOTSOCK 10038L
/ Henrik Grubbström (Lysator)
Previous text:
13658795 2005-09-15 11:34 /47 lines/ Brevbäraren Recipients: Pike (-) ticket import Subject: Protocols.DNS.client() not functional on Windows [3992]
Product: Pike Version: 7.4 Component: Modules Reporter: anders@roxen.com URL: https://community.roxen.com/crunch/show_bug.cgi?id=3992
All syncronous operations with Protocols.DNS.client is broken on windows. The following program only returns the expected result from the second part when using the async_client (which by the way is undocumented). This was tested on both Windows 2000 and 2003.
void got_result(string from, string to, mixed ... extra) { werror("Got result: %O, %O, %O\n", from, to, extra); } int main() { Protocols.DNS.client con = Protocols.DNS.client(); werror("Host: %O\n", con->gethostbyname("wwww.roxen.com")); werror("MX: %O\n", con->get_primary_mx("roxen.com")); werror("Sync: %O\n", con->do_sync_query(con->mkquery("pike.ida.liu.se", Protocols.DNS.C_IN, Protocols.DNS.T_A)));
Protocols.DNS.async_client dns = Protocols.DNS.async_client(); dns->host_to_ip("www.roxen.com", got_result); dns->get_mx("roxen.com", got_result);
return -17; }
When using Stdio.UDP directly this is the result: C:\pike\pike\7.4.326\bin>pike Pike v7.4 release 326 running Hilfe v3.5 (Incremental Pike Frontend)
object udp = Stdio.UDP(); string s =Protocols.DNS.protocol()->mkquery("www.roxen.com",
Protocols.DNS.C_IN, Protocols.DNS.T_A);
udp->bind(0);
(1) Result: Stdio.UDP()
udp->send("212.247.28.2", 53, s);
(2) Result: 31
udp->wait(5);
udp->wait(): select() failed with errno 10038 Stdio.UDP: Stdio.UDP()->wait(5) HilfeInput:1: HilfeInput()->___HilfeWrapper()
(13658795) /Brevbäraren/--------------------------------------------
pike-devel@lists.lysator.liu.se