Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Abnormal client termination not reported on server end (Using ASPNET middleware) #13

Open
johnds1974 opened this issue Jan 11, 2019 · 0 comments

Comments

@johnds1974
Copy link

johnds1974 commented Jan 11, 2019

So I have been playing around with this library in dotnet core, works great so far, except one thing I can't seem to get to work is how to be notified when a client (console app in my case for now) terminates abnormally. I need to know when a client connection closes (for whatever reason) so that the server end can react to it.

I'm using WebSocketRPC.AspCore v1.0.6, and calling:
`
app.UseWebSockets();
app.MapWebSocketRPC(
new PathString("/webservice"),
(ctx, c) =>
{
try
{
var b = c.Bind<WebService, IWebCallback>(new WebService());
c.OnOpen += async () =>
{
// gets called
};
c.OnClose += async (status, s) =>
{
// does not get called (only when client actually calls Connection.CloseAsync())
};
c.OnError += async ex =>
{
// Also does not get called when client abnormally closes (ie when i kill it)
};
}
catch(Exception ex)
{
}

            });

`

@johnds1974 johnds1974 changed the title Abnormal client termination not reported on server end Abnormal client termination not reported on server end (Using ASPNET middleware) Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant