All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH v1 1/2] dbus: Add support to tcp address
Date: Mon, 15 Apr 2019 11:59:29 -0500	[thread overview]
Message-ID: <00a29598-5f92-ac7d-28bd-fa0ca263588a@gmail.com> (raw)
In-Reply-To: <1555331007-26977-2-git-send-email-rhpr@cesar.org.br>

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

Hi Ramon,

On 04/15/2019 07:23 AM, Ramon Ribeiro wrote:
> This patch allows a dbus client to connect to a dbus-daemon server
> address listenning a TCP transport protocol.
> A non-blocking TCP socket is created to avoid blocking the main event
> loop.
> ---
>   ell/dbus.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>   1 file changed, 146 insertions(+), 5 deletions(-)
> 

<snip>

> +
> +	tv.tv_sec = 1;
> +	tv.tv_usec = 0;
> +
> +	// Wait until sockets be ready, otherwise a timeout is thrown
> +	if (select(fd + 1, &rfds, &wfds, NULL, &tv) == 0) {
> +		close(fd);
> +		return NULL;
> +	}

How does this help?  You're still sleeping in select and not allowing 
the main event loop to run.  You would need to setup an l_io for these 
fds (so that they're part of the main-event loop epoll_wait call) and 
wait for the connect to succeed or go on to next address.

Regards,
-Denis

  reply	other threads:[~2019-04-15 16:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-31 14:00 [PATCH 0/2] Allow connection to a tcp dbus address Ramon Henrique
2019-03-31 14:00 ` [PATCH 1/2] dbus: Add support to tcp address Ramon Henrique
2019-04-09 16:44   ` Denis Kenzior
2019-03-31 14:00 ` [PATCH 2/2] unit: dbus: Add unit test to dbus " Ramon Henrique
2019-04-15 12:23 ` [PATCH v1 0/2] Allow connection to a tcp dbus address Ramon Ribeiro
2019-04-15 12:23   ` [PATCH v1 1/2] dbus: Add support to tcp address Ramon Ribeiro
2019-04-15 16:59     ` Denis Kenzior [this message]
2019-04-15 12:23   ` [PATCH v1 2/2] unit: dbus: Add unit test to dbus " Ramon Ribeiro
2019-04-16 13:05   ` [PATCH v2 0/2] Allow connection to a tcp dbus address Ramon Ribeiro
2019-04-16 13:05     ` [PATCH v2 1/2] dbus: Add support to tcp address Ramon Ribeiro
2019-04-17 20:13       ` Denis Kenzior
2019-04-16 13:05     ` [PATCH v2 2/2] unit: dbus: Add unit test to dbus " Ramon Ribeiro

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=00a29598-5f92-ac7d-28bd-fa0ca263588a@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.