public override ResponseHeader CloseSession(RequestHeader requestHeader, bool deleteSubscriptions)
{
OperationContext context = ValidateRequest(requestHeader, RequestType.CloseSession);
try
{
ServerInternal.CloseSession(context, context.Session.Id, deleteSubscriptions);
return CreateResponse(requestHeader, context.StringTable);
}
catch (ServiceResultException e)
{
lock (ServerInternal.DiagnosticsLock)
{
ServerInternal.ServerDiagnostics.RejectedRequestsCount++;
if (IsSecurityError(e.StatusCode))
{
ServerInternal.ServerDiagnostics.SecurityRejectedRequestsCount++;
}
}
throw TranslateException(context, e);
}
finally
{
OnRequestComplete(context);
}
}