From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1754014784; bh=pmMHnWcFByI95Hg0XCH82eXSTdESjdaUArijN/MjuGE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To:Message-ID:Date:From:Reply-To:Subject:To: Cc:In-Reply-To:References:Resent-Date:Resent-From:Resent-To: Resent-Cc:User-Agent:Content-Type:Content-Transfer-Encoding; b=S5oVj0tbYiOUPicpKzNPUW02VWiRFofnXrVuwcjjfka+Hwztlar0P4xBO/QQT4Z+f x6FfX8g64U5b89lmrzmWz61Hsd41BB5UdFAsyb9AYDYS9IuMljBdCOwtRYh/xXtwTq qj3wngiHD1YGNMzPcsNgw/9sIJOcroHdn5mLIduhy3obXixyEPHHWqQzucVNHd0yIz /ZIzgHWs82dWiHkCqOUQIZW9QPqgrmDOf/0+mn5CClrMsacq/n9rNBDdaYs8095XaG Sd18bNf6yYPuHFuBz+Fyx0QEVoC9g5hZAIp6fpk9VBLrafqk/dRyL4T373N3la0N7B MkXXRAY+EbObw== Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.126.229]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 61A7F3126F06; Fri, 1 Aug 2025 02:19:43 +0000 (UTC) Date: Fri, 1 Aug 2025 11:19:39 +0900 From: Ammar Faizi To: Ahmad Gani Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: Re: [PATCH gwproxy v1 0/3] Initial work for DNS lookup implementation Message-ID: References: <20250731030856.366368-1-reyuki@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: 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