public static UnRegisterApplication ( this pClientApplication ) : void | ||
pClientApplication | this | |
Результат | void |
public static void Shutdown(BaseClientApplication pApplication) { //1. Get the list of all active protocols var protocols = ProtocolManager.ActiveProtocols; //2. enqueue for delete for all protocols bound to pApplication foreach (var p in protocols.Where(x => x.Value.Application != null && x.Value.Application.Id == pApplication.Id).Select(x => x.Value)) { p.Application = null; p.EnqueueForDelete(); } //1. Get the list of all active IOHandlers and enqueue for delete for all services bound to pApplication var handlers = IOHandlerManager.ActiveIoHandler; foreach (var h in handlers) { BaseProtocol pTemp = h.Value.Protocol; while (pTemp != null) { if ((pTemp.Application != null) && (pTemp.Application.Id == pApplication.Id)) { IOHandlerManager.EnqueueForDelete(h.Value); break; } pTemp = pTemp.NearProtocol; } } handlers = IOHandlerManager.ActiveIoHandler; foreach (var h in handlers) { if (h.Value.Type == IOHandlerType.IOHT_ACCEPTOR && ((TCPAcceptor)h.Value).Application != null && ((TCPAcceptor)h.Value).Application.Id == pApplication.Id) { IOHandlerManager.EnqueueForDelete(h.Value); } } //4. Unregister it ClientApplicationManager.UnRegisterApplication(pApplication); }