/// <summary> Creates an instance that uses the given <code>Parser</code></summary> /// <param name="theParser">parser to use for parsing and encoding messages /// </param> /// <param name="theProcessor">the <code>Processor</code> used to communicate /// with the remote system /// </param> public NuGenInitiatorImpl(Parser theParser, NuGenProcessor theProcessor) { myMetadataFields = new System.Collections.ArrayList(20); myParser = theParser; myProcessor = theProcessor; init(); }
override public void Run() { try { System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 1000)); } catch (System.Threading.ThreadInterruptedException) { } lock (processors.SyncRoot) { System.Collections.IEnumerator it = processors.GetEnumerator(); System.Collections.IList remove = new System.Collections.ArrayList(); while (it.MoveNext()) { NuGenProcessor proc = (NuGenProcessor)it.Current; if (!proc.Context.LocallyDrivenTransportLayer.Connected || !proc.Context.RemotelyDrivenTransportLayer.Connected) { //processors.Remove(it.Current); remove.Add(it.Current); } } foreach (object item in remove) { processors.Remove(item); } } }
private void newProcessor(NuGenProcessor theProcessor) { lock (myProcessors.SyncRoot) { myProcessors.Add(theProcessor); } }
/// <summary> Creates an instance that uses a <code>GenericParser</code></summary> /// <param name="theProcessor">the <code>Processor</code> used to communicate /// with the remote system /// </param> public NuGenInitiatorImpl(NuGenProcessor theProcessor) { myMetadataFields = new System.Collections.ArrayList(20); myMetadataFields.Add("MSH-18"); //add character set by default myParser = new GenericParser(); myProcessor = theProcessor; init(); }
public virtual void Run() { while (server.Running) { try { NuGenProcessor p = server.accept(theAddress); server.newProcessor(p); System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 1)); } catch (NuGenTransportException) { } catch (System.Threading.ThreadInterruptedException) { } } }
/// <param name="theProcessor">the processor on which to call cycle() /// </param> /// <param name="isExpectingAck">passed to cycle() /// </param> public Cycler(NuGenProcessor theProcessor, bool isExpectingAck) { myProcessor = theProcessor; myExpectingAck = isExpectingAck; isRunning = true; }