From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Ahmad Gani <reyuki@gnuweeb.org>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH gwproxy v1 0/3] Initial work for DNS lookup implementation
Date: Fri, 1 Aug 2025 11:19:39 +0900 [thread overview]
Message-ID: <aIwkO9Aw+IFht0vd@biznet-home.integral.gnuweeb.org> (raw)
In-Reply-To: <CAADvAgonYwm-mwHB-zC_MOb5gYWvd=eH2KeZ7h6WTSF0Tgud0A@mail.gmail.com>
On Fri, Aug 01, 2025 at 08:49:22AM +0700, reyuki wrote:
> I think I get the general idea of using pollable socket:
> - mark the UDP socket as non block
> - let the caller have reference to the socket, so they can poll it
>
> But have difficulties in the technical implementation:
>
> When the caller is notified, they must call what?
The same thing as other sockets. If you get EPOLLIN, that means there
is data to recv, so call recv/recvfrom.
> It is a UDP socket, it's said to be stateless, does connect can possibly
> return EINPROGRESS? It seems to be a common case in non-blocking
Most likely not. That will only set the dst addr. Apart from that, a
connect() call is optional if you use a UDP socket as a client.
sendto(2) and recvfrom(2) can be used if you ever want to use one
SOCK_DGRAM with multiple dst addresses.
> TCP socket. And if EAGAIN is received from recv, do we retry from send?
No, -EAGAIN from recv simply means the socket is non-blocking and there
is no data to be read at the moment.
> I find it unclear how the library and the program interact when using the
> non-blocking behavior, but I think I will give it a thought (maybe add an
> internal state to address these concerns).
The socks5 lib can do that. Why the DNS lib not?
> I can't view the linked message from the given link, is it a private community?
Oh, I didn't know if it was private. It seems the admins recently made
it private. I remember the days when it was public. But I have quoted
the needed sentences, I suppose that's enough.
--
Ammar Faizi
next prev parent reply other threads:[~2025-08-01 2:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 3:07 [PATCH gwproxy v1 0/3] Initial work for DNS lookup implementation Ahmad Gani
2025-07-31 3:07 ` [PATCH gwproxy v1 1/3] dnslookup: split common functionality and struct into net.c Ahmad Gani
2025-07-31 14:01 ` Ammar Faizi
2025-07-31 18:28 ` Alviro Iskandar Setiawan
2025-07-31 18:36 ` Ammar Faizi
2025-07-31 18:42 ` Alviro Iskandar Setiawan
2025-07-31 18:53 ` Ammar Faizi
2025-07-31 19:03 ` Alviro Iskandar Setiawan
2025-07-31 3:07 ` [PATCH gwproxy v1 2/3] dnslookup: Allow only port string number Ahmad Gani
2025-07-31 3:07 ` [PATCH gwproxy v1 3/3] dnslookup: Initial work for implementation of C-ares-like getaddrinfo function Ahmad Gani
2025-07-31 18:19 ` Alviro Iskandar Setiawan
2025-07-31 19:14 ` Alviro Iskandar Setiawan
2025-08-01 1:51 ` reyuki
2025-08-01 23:32 ` Alviro Iskandar Setiawan
2025-07-31 13:39 ` [PATCH gwproxy v1 0/3] Initial work for DNS lookup implementation Ammar Faizi
2025-08-01 1:49 ` reyuki
2025-08-01 2:19 ` Ammar Faizi [this message]
2025-08-05 6:28 ` reyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aIwkO9Aw+IFht0vd@biznet-home.integral.gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=alviro.iskandar@gnuweeb.org \
--cc=gwml@vger.gnuweeb.org \
--cc=reyuki@gnuweeb.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox