private static void SetDisconnected(object state) { var context = (OwinHttpListenerContext)state; context.End(new HttpListenerException(Constants.ErrorConnectionNoLongerValid)); }