I think i found why this is not working, as you can see below, socket is 
connected and first message is sent (the initialize message), which is answered 
and the response is read ({“result”: true}).

Problem is (and i’ve testing with golang and python) after the answer the 
“initialize” message, the socket is closed, so, getAllDomains message is being 
sent using a closed socket and that’s why i don’t see it on the responder side 
and pdns does not receive and answer, polls 2 times and reaches timeout.

i can see there’s no test for unixsocket in the source tree.

So this arises my question to you, do you think my conclusion is ok? do the 
unixconnector.cc <http://unixconnector.cc/> should be modified?


Context, im moving out from http to unixsocket to gain in speed, im not sure if 
using pipes will improve that or the UDS is still the best option.

Thanks again!! regards
 



> On 28 Nov 2023, at 16:37, Alexis Fidalgo <alz...@gmail.com> wrote:
> 
> has to be on my side. i made a change in the way i read/write to the socket 
> and now i get 
> 
> socket(AF_UNIX, SOCK_STREAM, 0)         = 12
> connect(12, {sa_family=AF_UNIX, sun_path="/tmp/pra.sock"}, 110) = 0
> write(12, "{\"method\": \"initialize\", \"parame"..., 66) = 66
> poll([{fd=12, events=POLLIN}], 1, 1000) = 1 ([{fd=12, revents=POLLIN}])
> read(12, "{\"result\":true}", 1500)     = 15
> write(12, "{\"method\": \"getAllDomains\", \"par"..., 70) = 70
> poll([{fd=12, events=POLLIN}], 1, 1000) = 0 (Timeout)
> poll([{fd=12, events=POLLIN}], 1, 1000) = 0 (Timeout)
> close(12)
> 
> pdns now dies after the two POLL (timeout), i’ll work on my read/write code 
> to fix this and let you know.
> 
> thanks again

_______________________________________________
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to