Note: It has been suggested that I sent this here. This is really addressed
to anyone who've used async_rpc_kernel library.
- The description says that its a "Platform-independant" library. What is
meant by that?
- There are a lot of dependencies; have someone ever tried to port it to
MirageOS?
- The handshake (for version negociation) in addition to the TCP handshake
makes short lived connections expensive. Wouldn't merely binding the version
to the port number (in other words, listens to as many ports as supported
versions) be both faster and simpler?
- I've always though streams should be implemented on top of RPC; can I ask
what special purpose you had when you decided to implement streams as a "first
class" protocol?
- You have some custom flow-control on top of TCP flow control. Can I ask why
it was necessary?
- Same question for keep-alive (although I understand that TCP keep alive is
a pain)?
- Regarding the keep-alive, the reception of any message could reset the
timeout (as oposed to only specificaly a keep-alive message). Why this choice?
- You decided to attach a state per connection, that servers can use to
store per client stuff. I am not a big fan of this, as I consider many times
this will be either unused or, in a world where the clients are authentified,
inapropriate (as you want a state per identification in that case not per
socket). Are many of your services actually use this?
- There is a deferred for when a connection stops. This can be used to save
the state I guess. Any other use case?
- I was surprised that a server may have a custom response to unknown incoming
messages. When is this useful for a service to customize this behavior?
- I'm not familiar with sexp_of_t but I guess there is no garantee that an
s-expression that can be unserialized into an ocaml value of a given type was
actually obtained from that type (a char may also be a string of length 1 for
instance). I guess as the received structures get more complex this is less
likelly to happen but still in a networked context the question of "remote"
type checking is interesting. Have you ever though of a way to garantee (or
make more likely) that a received message was indeed serialized by a
compatible version of sexplib from the expected type? In my pet project I'm
adding a hash of the type name + version but that's just meh.
On Fri, Jun 17, 2016 at 7:10 AM, rixed <ri...@happyleptic.org> wrote:
> - The handshake (for version negociation) in addition to the TCP handshake
> makes short lived connections expensive. Wouldn't merely binding the version
> to the port number (in other words, listens to as many ports as supported
> versions) be both faster and simpler?
We mostly haven't optimized for the short-lived connection case. The
port thing has its own set of
> - I've always though streams should be implemented on top of RPC;
> can I ask what special purpose you had when you decided to
> implement streams as a "first class" protocol?
Doing it as a first-class "protocol shape" makes sense, since it's a
common use case, and you can't really implement it any other way (RPCs
always have acks, but not so for each message down a pipe). We have
some dreams of using session types to make these shapes less first
class, but that's off in the unknown future.
> - You have some custom flow-control on top of TCP flow control. Can
> I ask why it was necessary?
Not sure.
> - Regarding the keep-alive, the reception of any message could reset
> the timeout (as oposed to only specificaly a keep-alive
> message). Why this choice?
Not sure.
> - You decided to attach a state per connection, that servers can use
> to store per client stuff. I am not a big fan of this, as I
> consider many times this will be either unused or, in a world
> where the clients are authentified, inapropriate (as you want a
> state per identification in that case not per socket). Are many of
> your services actually use this?
Having it chosen per client lets you construct the state any way you
want, so I think you can do it per authenticated user, once you get
your hands on the user.
Anyway, I think we do this a decent amount, but the most common case
is that the state is shared. I see no problem with the API as it
stands, though.
> - There is a deferred for when a connection stops. This can be used
> to save the state I guess. Any other use case?
I'm not sure off-hand, but I imagine it has lots of uses.