Ok, I've zoomed in a little and how have the implementation of EzRpcServer (and client) in my app so I can get at their innards.
I can see in the acceptLoop function where onDisconnected is called, and if I run some code when that promise is resolved I can go clean things up. But when I went to do that I realized I didn't know what to clean up.
When implementing an RPC call you get a signature like this:
::kj::Promise<void> createApp( CreateAppContext context )
(Where createApp is the name of the RPC call.)
That function is on the server implementation class for the main interface. In my case that's a class called AvServerImpl. There's one of those for the whole server and each client gets a capability that lets it make calls on that single server object. Or at least that's how it's working for me now.
I can't see anything in CreateAppContext that lets me know which client is actually making the call. And there's only one AvServerImpl, so that doesn't help either. I've read your coding standard, so I think it's unlikely that there's some global somewhere with a this bit of context stored in it. :)
So how do I associate a request with a specific client? Do I need to cause there to be multiple AvServerImpl objects somehow and then thunk over to the shared-across-all-clients implementation with this extra context attached? It looks like to do that I'd need one restorer per client since that seems to be what actually returns the main interface.
Joe