From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, "Eric Blake" <eblake@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/8] io: introduce a network socket listener API
Date: Fri, 11 Aug 2017 13:48:21 +0100 [thread overview]
Message-ID: <20170811124821.GL2554@redhat.com> (raw)
In-Reply-To: <20170811123942.GC2076@work-vm>
On Fri, Aug 11, 2017 at 01:39:43PM +0100, Dr. David Alan Gilbert wrote:
> * Daniel P. Berrange (berrange@redhat.com) wrote:
> > On Fri, Aug 11, 2017 at 01:26:00PM +0100, Dr. David Alan Gilbert wrote:
> > > * Daniel P. Berrange (berrange@redhat.com) wrote:
> > > > The existing QIOChannelSocket class provides the ability to
> > > > listen on a single socket at a time. This patch introduces
> > > > a QIONetListener class that provides a higher level API
> > > > concept around listening for network services, allowing
> > > > for listening on multiple sockets.
> > >
> > > What protects against a connection on more than one of the sockets?
> >
> > That's not the responsibility of this module. If a backend only
> > wants to allow a single client at a time, it has to unregister
> > the new client callback and re-register when it is ready to
> > accept a new client. This aspect is no different to the existing
> > case of multiple clients connecting to a single listener socket.
>
> OK, and we guarantee that we never call accept() twice because we
> make sure we do that unregister before we get back to the main loop?
Yes, and even if 2 clients arrive at exactly the same time, and thus
both sockets show G_IO_IN on the same iteration of the main loop,
we check whether the new client callback is NULL, and so will just
drop the 2nd client.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-08-11 12:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 16:04 [Qemu-devel] [PATCH 0/8] Enable full IPv4/IPv6 dual stack support Daniel P. Berrange
2017-08-10 16:04 ` [Qemu-devel] [PATCH 1/8] tests: add functional test validating ipv4/ipv6 address flag handling Daniel P. Berrange
2017-08-10 16:04 ` [Qemu-devel] [PATCH 2/8] io: introduce a network socket listener API Daniel P. Berrange
2017-08-10 18:12 ` Eric Blake
2017-08-11 9:15 ` Daniel P. Berrange
2017-08-11 10:18 ` Daniel P. Berrange
2017-08-11 12:26 ` Dr. David Alan Gilbert
2017-08-11 12:29 ` Daniel P. Berrange
2017-08-11 12:39 ` Dr. David Alan Gilbert
2017-08-11 12:48 ` Daniel P. Berrange [this message]
2017-08-10 16:04 ` [Qemu-devel] [PATCH 3/8] blockdev: convert internal NBD server to QIONetListener Daniel P. Berrange
2017-08-10 18:15 ` Eric Blake
2017-08-10 16:04 ` [Qemu-devel] [PATCH 4/8] blockdev: convert qemu-nbd " Daniel P. Berrange
2017-08-10 18:27 ` Eric Blake
2017-08-10 16:04 ` [Qemu-devel] [PATCH 5/8] migration: convert socket " Daniel P. Berrange
2017-08-10 16:04 ` [Qemu-devel] [PATCH 6/8] chardev: convert the " Daniel P. Berrange
2017-08-10 16:04 ` [Qemu-devel] [PATCH 7/8] ui: convert VNC " Daniel P. Berrange
2017-08-10 16:04 ` [Qemu-devel] [PATCH 8/8] sockets: fix parsing of ipv4/ipv6 opts in parse_socket_addr Daniel P. Berrange
2017-08-10 18:35 ` Eric Blake
2017-08-11 9:22 ` Daniel P. Berrange
2017-08-10 16:33 ` [Qemu-devel] [PATCH 0/8] Enable full IPv4/IPv6 dual stack support no-reply
2017-08-10 16:33 ` no-reply
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=20170811124821.GL2554@redhat.com \
--to=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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.