Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/16 15:15:19 (8 years ago)
Author:
thasling
Message:

added new empty project for test on hive
changed scheme for ip determination
changed handling of queues in messagehandler

File:
1 edited

Legend:

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

    r13538 r13541  
    99namespace DistributedGA.Core.Implementation {
    1010  public class WcfPeerListManager : IPeerListManager {
    11     private string SERVER_STRING = null;
     11    private string serverString = null;
    1212
    1313    private IContactService client = null;
     
    1919
    2020    public void Init(PeerInfo source) {
    21       SERVER_STRING = ConfigurationManager.AppSettings["ContactServerURL"];
     21      serverString = ConfigurationManager.AppSettings["ContactServerURL"];
    2222      client = CreateClient();
    2323      myself = source;
     
    4141    private IContactService CreateClient() {
    4242      var binding = new BasicHttpBinding();
    43       var endpoint = new EndpointAddress(SERVER_STRING);
     43      var endpoint = new EndpointAddress(serverString);
    4444      var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint);
    4545
     
    5252      //communicate with 10% of the network
    5353      int noOfPeers = allPeers.Count / 10;
    54       List<Int32> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
     54      List<int> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
    5555      List<PeerInfo> res = new List<PeerInfo>();
    56       foreach (Int32 index in indexList) {
     56      foreach (int index in indexList) {
    5757        res.Add(allPeers.ElementAt(index));
    5858      }
     
    6060    }
    6161
    62     private List<Int32> GetRandomItemIndexes(int noOfItems, int minValue, int maxValue) {
    63       List<Int32> res = new List<Int32>();
     62    private List<int> GetRandomItemIndexes(int noOfItems, int minValue, int maxValue) {
     63      List<int> res = new List<int>();
    6464      Random rnd = new Random();
    6565      int tmp = -1;
Note: See TracChangeset for help on using the changeset viewer.