public void StopProcessProtocolListenerChannel(string protocolId, int listenerChannelId, bool immediate) { try { if (protocolId == null) { throw new ArgumentNullException("protocolId"); } ProcessProtocolHandler handler = null; lock (this) { handler = this._protocolHandlers[protocolId] as ProcessProtocolHandler; } if (handler != null) { handler.StopListenerChannel(listenerChannelId, immediate); } } catch (Exception exception) { using (new ProcessImpersonationContext()) { Misc.ReportUnhandledException(exception, new string[] { System.Web.SR.GetString("Failure_Stop_Listener_Channel") }); } throw; } }
public void StartProcessProtocolListenerChannel(string protocolId, IListenerChannelCallback listenerChannelCallback) { try { if (protocolId == null) { throw new ArgumentNullException("protocolId"); } ProtocolElement element = this.ProtocolsConfig.Protocols[protocolId]; if (element == null) { throw new ArgumentException(System.Web.SR.GetString("Unknown_protocol_id", new object[] { protocolId })); } ProcessProtocolHandler handler = null; Type type = null; type = this.ValidateAndGetType(element, element.ProcessHandlerType, typeof(ProcessProtocolHandler), "ProcessHandlerType"); lock (this) { handler = this._protocolHandlers[protocolId] as ProcessProtocolHandler; if (handler == null) { handler = (ProcessProtocolHandler)Activator.CreateInstance(type); this._protocolHandlers[protocolId] = handler; } } if (handler != null) { handler.StartListenerChannel(listenerChannelCallback, this); } } catch (Exception exception) { using (new ProcessImpersonationContext()) { Misc.ReportUnhandledException(exception, new string[] { System.Web.SR.GetString("Invalid_Process_Prot_Type") }); } throw; } }