patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: "Cole Helbling" <cole.e.helbling@outlook.com>
To: "Alyssa Ross" <hi@alyssa.is>, <devel@spectrum-os.org>
Subject: Re: [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt
Date: Mon, 15 Jun 2020 17:17:47 -0700	[thread overview]
Message-ID: <CH2PR14MB357902F389083AFA8FA045DDB39D0@CH2PR14MB3579.namprd14.prod.outlook.com> (raw)
In-Reply-To: <20200614114344.22642-2-hi@alyssa.is>

On Sun Jun 14, 2020 at 11:43 AM, Alyssa Ross wrote:
> Occasionally, it is useful to be able to use UnixSeqpacket as a type
> that can represent any kind of MsgSocket. For example, to keep some
> MsgSockets of different types in a Vec. In this case, it may be known
> what type of messages should be sent over a socket, even though that
> may not be represantable in the type system.
>
> To accomodate this situation, this patch introduces send_msg_on_socket
> and recv_msg_on_socket methods on UnixSeqpacket, that can be used to
> send or receive any kind of MsgOnSocket. The caller is obviously
> responsible for ensuring that the messages being sent are of the type
> expected by the socket.
>
> This lack of type safety for message types is not ideal, and so
> MsgSender and MsgReceiver should still be preferred wherever possible.

Is there anyway this can or will be rectified?

> ---
> msg_socket/src/lib.rs | 52 ++++++++++++++++++++++++++-----------------
> 1 file changed, 32 insertions(+), 20 deletions(-)

Otherwise, I don't see anything obviously wrong, but I'm also not very
familiar with sockets.

Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>

  reply	other threads:[~2020-06-16  0:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 11:43 [PATCH crosvm 0/2] Fix deadlock on early VmRequest Alyssa Ross
2020-06-14 11:43 ` [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt Alyssa Ross
2020-06-16  0:17   ` Cole Helbling [this message]
2020-06-16  9:32     ` Alyssa Ross
2020-06-22 22:06       ` Cole Helbling
2020-06-23  2:32         ` Alyssa Ross
2020-06-25  1:54       ` impaqt
2020-07-09 13:24         ` Alyssa Ross
2020-06-14 11:43 ` [PATCH crosvm 2/2] crosvm: fix deadlock on early VmRequest Alyssa Ross
2020-06-16  1:08   ` Cole Helbling
2020-06-16  9:39     ` Alyssa Ross

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=CH2PR14MB357902F389083AFA8FA045DDB39D0@CH2PR14MB3579.namprd14.prod.outlook.com \
    --to=cole.e.helbling@outlook.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /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.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).