NetPipe/PipeServer/NamedPipeServer.cs
/// <summary>
/// A routine to clean NamedPipeServerInstances. When disposeAll is true,
/// it will dispose all server instances. Otherwise, it will only dispose
/// the instances that are completed, canceled, or faulted.
/// PS: disposeAll is true only for this.Dispose()
/// </summary>
/// <param name="disposeAll"></param>
A routine to clean NamedPipeServerInstances. When disposeAll is true,
it will dispose all server instances. Otherwise, it will only dispose
the instances that are completed, canceled, or faulted.
PS: disposeAll is true only for this.Dispose()
A routine to clean NamedPipeServerInstances . When disposeAll is true it will dispose all server instances . Otherwise it will only dispose the instances that are completed canceled or faulted . PS : disposeAll is true only for this . Dispose ()
private void CleanServers(bool disposeAll)
        {
            if (disposeAll)
            {
                foreach (NamedPipeServerInstance server in servers)
                {
                    server.Dispose();
                    disposeEvent.Invoke(this, "Dispose");
                }
                servers.Clear();
            }
            else
            {
                for (int i = servers.Count - 1; i >= 0; i--)
                {
                    if (servers[i] == null)
                    {
                        servers.RemoveAt(i);
                    }
                    else if (servers[i].TaskCommunication != null &&
                        (servers[i].TaskCommunication.Status == TaskStatus.RanToCompletion ||
                        servers[i].TaskCommunication.Status == TaskStatus.Canceled ||
                        servers[i].TaskCommunication.Status == TaskStatus.Faulted))
                    {
                        servers[i].Dispose();
                        servers.RemoveAt(i);
                        disposeEvent.Invoke(this, "Dispose at " + i);
                    }
                }
            }
        }
private void CleanServers ( bool disposeAll ) { if ( disposeAll ) { foreach ( NamedPipeServerInstance server in servers ) { server . Dispose ( ) ; disposeEvent . Invoke ( this , " " ) ; } servers . Clear ( ) ; } else { for ( int i = servers . Count - 1 ; i >= 0 ; i -- ) { if ( servers [ i ] == null ) { servers . RemoveAt ( i ) ; } else if ( servers [ i ] . TaskCommunication != null && ( servers [ i ] . TaskCommunication . Status == TaskStatus . RanToCompletion || servers [ i ] . TaskCommunication . Status == TaskStatus . Canceled || servers [ i ] . TaskCommunication . Status == TaskStatus . Faulted ) ) { servers [ i ] . Dispose ( ) ; servers . RemoveAt ( i ) ; disposeEvent . Invoke ( this , " " + i ) ; } } } }
A routine to clean NamedPipeServerInstances.
A routine to clean NamedPipeServerInstances .
disposeAll
bool
None