Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/16 15:28:29 (9 years ago)
Author:
thasling
Message:

Added Dispose() to MessageHandler and WCF service host

Location:
branches/thasling/DistributedGA/DistributedGA.Core/Implementation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs

    r13541 r13547  
    2424    private ConcurrentQueue<SolutionInfo> writeQueue;
    2525    private ConcurrentQueue<SolutionInfo> readQueue;
    26     private bool collectingInFirstQueue = true; //currently first queue is filled with recieved populations
    2726
    2827    //uses IMessageService for recieving population from one peer at once
     
    5554      } catch (Exception ex) {
    5655        AddError("PeerNetworkMessageHandler.Init", ex);
     56      }
     57    }
     58
     59    public void Dispose() {
     60      try {
     61        host.Dispose();
     62      } catch (Exception ex) {
     63        AddError("PeerNetworkMessageHandler.Dispose", ex);
    5764      }
    5865    }
     
    144151      }
    145152    }
     153
    146154  }
    147155}
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs

    r13541 r13547  
    4242    }
    4343
     44    public void Dispose() {
     45      _ResetEvent.Set();
     46    }
     47
    4448    private int FreeTcpPort() {
    4549      TcpListener l = new TcpListener(IPAddress.Loopback, 0);
     
    5559      }
    5660    }
    57 
    5861  }
    5962}
Note: See TracChangeset for help on using the changeset viewer.