You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.
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)
{
}
});
`
The text was updated successfully, but these errors were encountered:
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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)
{
}
`
The text was updated successfully, but these errors were encountered: