From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v3 3/7] hfp_ag_bluez5: Remove fd from hash when disconnect
Date: Thu, 18 Apr 2013 08:53:03 -0500 [thread overview]
Message-ID: <516FFABF.8020706@gmail.com> (raw)
In-Reply-To: <1366062110-28031-4-git-send-email-paulo.borges@openbossa.org>
[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]
Hi Paulo,
On 04/15/2013 04:41 PM, Paulo Borges wrote:
> When a RequestDisconnect() is received, the file descriptor must be
> closed. This way, the related emulator will be freed.
Actually you need to call shutdown() on it. When multiple references to
the file descriptor exist, close() simply deletes a reference. It does
not close the actual socket.
>
> But the emulator can also be disconnected automatically if its
> GAtServer closes. In this case, the hash will hold an invalid file
> descriptor.
>
> So, after the emulator is registered, we watch for G_IO_HUP in
> the corresponding file descriptor. If this condition happens, we
> can safely remove the file descriptor from the hash.
Overall I like this approach much better than the previous one. I'd
still re-arrange the patch set as follows:
- init/free hash table (same as patch 1)
- G_IO_HUP changes
- RequestDisconnect implementation
> ---
> plugins/hfp_ag_bluez5.c | 43 ++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 40 insertions(+), 3 deletions(-)
>
Regards,
-Denis
next prev parent reply other threads:[~2013-04-18 13:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 21:41 [PATCH v3 0/7] Clear the ground for AG card implementation Paulo Borges
2013-04-15 21:41 ` [PATCH v3 1/7] hfp_ag_bluez5: Create a hash to store connections Paulo Borges
2013-04-15 21:41 ` [PATCH v3 2/7] hfp_ag_bluez5: Store fd in hash when connect Paulo Borges
2013-04-15 21:41 ` [PATCH v3 3/7] hfp_ag_bluez5: Remove fd from hash when disconnect Paulo Borges
2013-04-18 13:53 ` Denis Kenzior [this message]
2013-04-18 19:57 ` Paulo Borges
2013-04-15 21:41 ` [PATCH v3 4/7] phonesim: Include hfp.h Paulo Borges
2013-04-18 13:43 ` Denis Kenzior
2013-04-15 21:41 ` [PATCH v3 5/7] hfp_ag_bluez5: " Paulo Borges
2013-04-18 13:44 ` Denis Kenzior
2013-04-15 21:41 ` [PATCH v3 6/7] hfp: Move HFP versions definitions to hfp.h Paulo Borges
2013-04-18 13:44 ` Denis Kenzior
2013-04-15 21:41 ` [PATCH v3 7/7] hfp_ag_bluez5: Remove unused includes Paulo Borges
2013-04-18 13:44 ` Denis Kenzior
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=516FFABF.8020706@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.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