Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13924


Ignore:
Timestamp:
06/19/16 23:32:37 (8 years ago)
Author:
thasling
Message:

#2615:
delete unneeded project, appended code style

Location:
branches/thasling/DistributedGA
Files:
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.ContactServer.Host/Program.cs

    r13887 r13924  
    22using System.ServiceModel;
    33
    4 namespace DistributedGA.ContactServer.Host
    5 {
    6     class Program
    7     {
    8         static void Main(string[] args)
    9         {
    10             string baseAddress = string.Empty;
    11             if (args.GetUpperBound(0) > -1)
    12             {
    13                 baseAddress = args[0];
    14             }
    15             if (string.IsNullOrWhiteSpace(baseAddress))
    16             {
    17                 baseAddress = "net.tcp://localhost:9090/DistributedGA.ContactServer/ContactService";
    18             }
    19             using (ServiceHost host = new ServiceHost(typeof(ContactServiceImpl), new Uri[] { new Uri(baseAddress) }))
    20             {
    21                 // Enable metadata publishing.
     4namespace DistributedGA.ContactServer.Host {
     5  class Program {
     6    static void Main(string[] args) {
     7      string baseAddress = string.Empty;
     8      if (args.GetUpperBound(0) > -1) {
     9        baseAddress = args[0];
     10      }
     11      if (string.IsNullOrWhiteSpace(baseAddress)) {
     12        baseAddress = "net.tcp://localhost:9090/DistributedGA.ContactServer/ContactService";
     13      }
     14      using (ServiceHost host = new ServiceHost(typeof(ContactServiceImpl), new Uri[] { new Uri(baseAddress) })) {
     15        // Enable metadata publishing.
    2216
    2317
    24                 // Open the ServiceHost to start listening for messages. Since
    25                 // no endpoints are explicitly configured, the runtime will create
    26                 // one endpoint per base address for each service contract implemented
    27                 // by the service.
     18        // Open the ServiceHost to start listening for messages. Since
     19        // no endpoints are explicitly configured, the runtime will create
     20        // one endpoint per base address for each service contract implemented
     21        // by the service.
    2822
    29                 host.Open();
     23        host.Open();
    3024
    31                 Console.WriteLine("The service is ready at {0}", baseAddress);
    32                 Console.WriteLine("Press <Enter> to stop the service.");
    33                 Console.ReadLine();
     25        Console.WriteLine("The service is ready at {0}", baseAddress);
     26        Console.WriteLine("Press <Enter> to stop the service.");
     27        Console.ReadLine();
    3428
    35                 // Close the ServiceHost.
    36                 host.Close();
    37             }
    38         }
     29        // Close the ServiceHost.
     30        host.Close();
     31      }
    3932    }
     33  }
    4034}
  • branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs

    r13918 r13924  
    3030      try {
    3131        UpdateHeartbeat(source);
    32       } catch (Exception ex) {
     32      }
     33      catch (Exception ex) {
    3334        AddError("ContactServiceImpl.RegisterPeer", ex);
    3435      }
     
    4647            return false;
    4748        }).ToList();
    48       } catch (Exception ex) {
     49      }
     50      catch (Exception ex) {
    4951        AddError("ContactServiceImpl.GetPeerList", ex);
    5052        return null;
     
    5860          File.AppendAllText("Log.txt", string.Concat(source.IpAddress, ":", source.Port, ",", source.ProblemInstance, ",", msg, Environment.NewLine));
    5961        }
    60       } catch (Exception ex) {
     62      }
     63      catch (Exception ex) {
    6164        //Nothing to do because maybe called from adderror
    6265      }
     
    6871        DateTime now = DateTime.Now;
    6972        allPeers.AddOrUpdate(source, now, (k, v) => v = now);
    70       } catch (Exception ex) {
     73      }
     74      catch (Exception ex) {
    7175        AddError("ContactServiceImpl.UpdateHeartbeat", ex);
    7276      }
  • branches/thasling/DistributedGA/DistributedGA.ContactServer/IContactService.cs

    r13887 r13924  
    77using System.Threading.Tasks;
    88
    9 namespace DistributedGA.ContactServer
    10 {
    11     [ServiceContract]
    12     public interface IContactService
    13     {
    14         [OperationContract]
    15         void RegisterPeer(PeerInfo source); //Registers own instance at the contact-server
     9namespace DistributedGA.ContactServer {
     10  [ServiceContract]
     11  public interface IContactService {
     12    [OperationContract]
     13    void RegisterPeer(PeerInfo source); //Registers own instance at the contact-server
    1614
    17         [OperationContract]
    18         List<PeerInfo> GetPeerList(PeerInfo source); //Recieves all peers in the network from contact-server
     15    [OperationContract]
     16    List<PeerInfo> GetPeerList(PeerInfo source); //Recieves all peers in the network from contact-server
    1917
    20         [OperationContract]
    21         void UpdateHeartbeat(PeerInfo source); //Sends heartbeat to contact-server
     18    [OperationContract]
     19    void UpdateHeartbeat(PeerInfo source); //Sends heartbeat to contact-server
    2220
    23         [OperationContract]
    24         void MakeLog(PeerInfo source, string msg); //Used to log all peers at a single location
     21    [OperationContract]
     22    void MakeLog(PeerInfo source, string msg); //Used to log all peers at a single location
    2523
    26     }
     24  }
    2725}
  • branches/thasling/DistributedGA/DistributedGA.Core/Domain/MessageRecieveEventArgs.cs

    r13887 r13924  
    11using System;
    22
    3 namespace DistributedGA.Core.Domain
    4 {
    5     public class MessageRecieveEventArgs : EventArgs
    6     {
    7         public int val;
    8         public byte[][] data { get; set; }
    9         public PeerInfo Sender { get; set; }
    10     }
     3namespace DistributedGA.Core.Domain {
     4  public class MessageRecieveEventArgs : EventArgs {
     5    public int val;
     6    public byte[][] data { get; set; }
     7    public PeerInfo Sender { get; set; }
     8  }
    119}
  • branches/thasling/DistributedGA/DistributedGA.Core/Domain/PeerInfo.cs

    r13524 r13924  
    55using System.Threading.Tasks;
    66
    7 namespace DistributedGA.Core.Domain
    8 {
    9     //containts contact information of one peer
    10     public class PeerInfo
    11     {
    12         public int Port { get; set; }
    13         public string IpAddress { get; set; }
    14         public string ProblemInstance { get; set; }
     7namespace DistributedGA.Core.Domain {
     8  //containts contact information of one peer
     9  public class PeerInfo {
     10    public int Port { get; set; }
     11    public string IpAddress { get; set; }
     12    public string ProblemInstance { get; set; }
    1513
    16         public override bool Equals(System.Object obj)
    17         {
    18             if (obj == null)
    19             {
    20                 return false;
    21             }
     14    public override bool Equals(System.Object obj) {
     15      if (obj == null) {
     16        return false;
     17      }
    2218
    23             PeerInfo p = obj as PeerInfo;
    24             if ((System.Object)p == null)
    25             {
    26                 return false;
    27             }
     19      PeerInfo p = obj as PeerInfo;
     20      if ((System.Object)p == null) {
     21        return false;
     22      }
    2823
    29             return p.Port.Equals(this.Port) && p.IpAddress.Equals(this.IpAddress);
    30         }
    31         public override int GetHashCode()
    32         {
    33             return this.IpAddress.GetHashCode();
    34         }
     24      return p.Port.Equals(this.Port) && p.IpAddress.Equals(this.IpAddress);
    3525    }
     26    public override int GetHashCode() {
     27      return this.IpAddress.GetHashCode();
     28    }
     29  }
    3630}
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/MessageContractImpl.cs

    r13887 r13924  
    44using DistributedGA.Core.Interface;
    55
    6 namespace DistributedGA.Core.Implementation
    7 {
    8     [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    9     public class MessageContractImpl : IMessageContract
    10     {
    11         public void SendData(PeerInfo sender, byte[][] data)
    12         {
    13             MessageRecieveEventArgs args = new MessageRecieveEventArgs() { Sender = sender, data = data };
     6namespace DistributedGA.Core.Implementation {
     7  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
     8  public class MessageContractImpl : IMessageContract {
     9    public void SendData(PeerInfo sender, byte[][] data) {
     10      MessageRecieveEventArgs args = new MessageRecieveEventArgs() { Sender = sender, data = data };
    1411
    15             if (MessageRecieved != null)
    16             {
    17                 MessageRecieved(this, args);
    18             }
    19         }
     12      if (MessageRecieved != null) {
     13        MessageRecieved(this, args);
     14      }
     15    }
    2016
    21         public event EventHandler<MessageRecieveEventArgs> MessageRecieved;
     17    public event EventHandler<MessageRecieveEventArgs> MessageRecieved;
    2218
    23     }
     19  }
    2420}
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs

    r13918 r13924  
    77using DistributedGA.Core.Interface;
    88
    9 namespace DistributedGA.Core.Implementation
    10 {
    11     public class PeerNetworkMessageHandler : IMessageHandler
    12     {
    13         //own peer-instance Information
    14         private PeerInfo ownInstance = null;
     9namespace DistributedGA.Core.Implementation {
     10  public class PeerNetworkMessageHandler : IMessageHandler {
     11    //own peer-instance Information
     12    private PeerInfo ownInstance = null;
    1513
    16         //uses peer-list from IPeerListManager to decide which peers to contact
    17         private IPeerListManager peerListManager;
     14    //uses peer-list from IPeerListManager to decide which peers to contact
     15    private IPeerListManager peerListManager;
    1816
    19         //uses IMessageSender to send populations to peers
    20         private IMessageSender sender = null;
     17    //uses IMessageSender to send populations to peers
     18    private IMessageSender sender = null;
    2119
    22         //provides current population for the higher layer IMigrationOperator
    23         //to queues are used to gather and and provide population more efficiently
    24         private object activeQueueLocker = new object();
    25         private ConcurrentQueue<byte[]> writeQueue;
    26         private ConcurrentQueue<byte[]> readQueue;
     20    //provides current population for the higher layer IMigrationOperator
     21    //to queues are used to gather and and provide population more efficiently
     22    private object activeQueueLocker = new object();
     23    private ConcurrentQueue<byte[]> writeQueue;
     24    private ConcurrentQueue<byte[]> readQueue;
    2725
    28         //uses IMessageService for recieving population from one peer at once
    29         private IMessageService host = null;
     26    //uses IMessageService for recieving population from one peer at once
     27    private IMessageService host = null;
    3028
    3129
    3230
    33         public void Init(string lanIpPrefix, string contactServerUrl)
    34         {
    35             try
    36             {
    37                 ownInstance = new PeerInfo()
    38                 {
    39                     IpAddress = GetInternalIpAddress(lanIpPrefix),
    40                     Port = 0,
    41                     ProblemInstance = "TestProblem"
    42                 }; // TODO: get own peerinfo
     31    public void Init(string lanIpPrefix, string contactServerUrl) {
     32      try {
     33        ownInstance = new PeerInfo() {
     34          IpAddress = GetInternalIpAddress(lanIpPrefix),
     35          Port = 0,
     36          ProblemInstance = "TestProblem"
     37        }; // TODO: get own peerinfo
    4338
    44                 writeQueue = new ConcurrentQueue<byte[]>();
    45                 readQueue = new ConcurrentQueue<byte[]>();
     39        writeQueue = new ConcurrentQueue<byte[]>();
     40        readQueue = new ConcurrentQueue<byte[]>();
    4641
    4742
    48                 host = new WcfMessageService();
    49                 ownInstance.Port = host.Init(ownInstance.IpAddress); //getting port, on which service is hostet
    50                 host.OnDataRecieved += new EventHandler<MessageRecieveEventArgs>(OnPopulationRecieved);
     43        host = new WcfMessageService();
     44        ownInstance.Port = host.Init(ownInstance.IpAddress); //getting port, on which service is hostet
     45        host.OnDataRecieved += new EventHandler<MessageRecieveEventArgs>(OnPopulationRecieved);
    5146
    52                 peerListManager = new WcfPeerListManager();
    53                 peerListManager.Init(ownInstance, contactServerUrl);
     47        peerListManager = new WcfPeerListManager();
     48        peerListManager.Init(ownInstance, contactServerUrl);
    5449
    55                 sender = new WcfMessageSender();
    56                 sender.Init(ownInstance);
     50        sender = new WcfMessageSender();
     51        sender.Init(ownInstance);
    5752
    58             }
    59             catch (Exception ex)
    60             {
    61                 AddError("PeerNetworkMessageHandler.Init", ex);
    62             }
     53      }
     54      catch (Exception ex) {
     55        AddError("PeerNetworkMessageHandler.Init", ex);
     56      }
     57    }
     58
     59    public void Dispose() {
     60      try {
     61        host.Dispose();
     62        sender.Dispose();
     63        peerListManager.Dispose();
     64      }
     65      catch (Exception ex) {
     66        AddError("PeerNetworkMessageHandler.Dispose", ex);
     67      }
     68    }
     69
     70    public void PublishDataToNetwork(byte[][] data) {
     71      try {
     72        foreach (PeerInfo peer in peerListManager.GetPeerList()) {
     73          //maybe something will go wrong during network communication...
     74          try {
     75            sender.SendData(peer, data);
     76          }
     77          catch (Exception ex) {
     78            AddError("PeerNetworkMessageHandler.PublishDataToNetwork(during sending to one peer!)", ex);
     79          }
     80        }
     81      }
     82      catch (Exception ex) {
     83        AddError("PeerNetworkMessageHandler.PublishDataToNetwork", ex);
     84      }
     85    }
     86
     87    public byte[][] GetDataFromNetwork() {
     88      try {
     89        List<byte[]> res = new List<byte[]>();
     90        byte[] item = null;
     91        lock (activeQueueLocker) {
     92          var tmp = readQueue;
     93          readQueue = writeQueue;
     94          writeQueue = tmp;
    6395        }
    6496
    65         public void Dispose()
    66         {
    67             try
    68             {
    69                 host.Dispose();
    70                 sender.Dispose();
    71                 peerListManager.Dispose();
    72             }
    73             catch (Exception ex)
    74             {
    75                 AddError("PeerNetworkMessageHandler.Dispose", ex);
    76             }
     97        //creating resultset
     98        while (!readQueue.IsEmpty) {
     99          if (readQueue.TryDequeue(out item)) {
     100            res.Add(item);
     101          }
    77102        }
     103        return res.ToArray();
     104      }
     105      catch (Exception ex) {
     106        AddError("PeerNetworkMessageHandler.GetDataFromNetwork", ex);
     107        return null;
     108      }
     109    }
    78110
    79         public void PublishDataToNetwork(byte[][] data)
    80         {
    81             try
    82             {
    83                 foreach (PeerInfo peer in peerListManager.GetPeerList())
    84                 {
    85                     //maybe something will go wrong during network communication...
    86                     try
    87                     {
    88                         sender.SendData(peer, data);
    89                     }
    90                     catch (Exception ex)
    91                     {
    92                         AddError("PeerNetworkMessageHandler.PublishDataToNetwork(during sending to one peer!)", ex);
    93                     }
    94                 }
    95             }
    96             catch (Exception ex)
    97             {
    98                 AddError("PeerNetworkMessageHandler.PublishDataToNetwork", ex);
    99             }
     111    public PeerInfo GetPeerInfo() {
     112      return ownInstance;
     113    }
     114
     115    public List<PeerInfo> GetCurrentNetwork() {
     116      return peerListManager.GetPeerList();
     117    }
     118
     119    private string GetInternalIpAddress(string ipPrefix) {
     120      try {
     121        var strHostName = Dns.GetHostName();
     122        // Then using host name, get the IP address list..
     123        IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
     124        IPAddress[] addr = ipEntry.AddressList;
     125
     126        return addr
     127          .Select(ip => ip.ToString())
     128          .First(str => str.StartsWith(ipPrefix));
     129      }
     130      catch { return null; }
     131    }
     132
     133    private void OnPopulationRecieved(object sender, MessageRecieveEventArgs e) {
     134      if (e != null) {
     135        lock (activeQueueLocker) {
     136          foreach (byte[] item in e.data) {
     137            writeQueue.Enqueue(item);
     138          }
    100139        }
     140      }
     141    }
    101142
    102         public byte[][] GetDataFromNetwork()
    103         {
    104             try
    105             {
    106                 List<byte[]> res = new List<byte[]>();
    107                 byte[] item = null;
    108                 lock (activeQueueLocker)
    109                 {
    110                     var tmp = readQueue;
    111                     readQueue = writeQueue;
    112                     writeQueue = tmp;
    113                 }
     143    private void AddError(string source, Exception ex) {
     144      if (peerListManager != null) {
     145        try {
     146          peerListManager.SendLogToServer(string.Concat("Source: ", source, ", Exception: ", ex.Message));
     147        }
     148        catch { }
     149      }
     150    }
    114151
    115                 //creating resultset
    116                 while (!readQueue.IsEmpty)
    117                 {
    118                     if (readQueue.TryDequeue(out item))
    119                     {
    120                         res.Add(item);
    121                     }
    122                 }
    123                 return res.ToArray();
    124             }
    125             catch (Exception ex)
    126             {
    127                 AddError("PeerNetworkMessageHandler.GetDataFromNetwork", ex);
    128                 return null;
    129             }
    130         }
    131 
    132         public PeerInfo GetPeerInfo()
    133         {
    134             return ownInstance;
    135         }
    136 
    137         public List<PeerInfo> GetCurrentNetwork()
    138         {
    139             return peerListManager.GetPeerList();
    140         }
    141 
    142         private string GetInternalIpAddress(string ipPrefix)
    143         {
    144             try
    145             {
    146                 var strHostName = Dns.GetHostName();
    147                 // Then using host name, get the IP address list..
    148                 IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
    149                 IPAddress[] addr = ipEntry.AddressList;
    150 
    151                 return addr
    152                   .Select(ip => ip.ToString())
    153                   .First(str => str.StartsWith(ipPrefix));
    154             }
    155             catch { return null; }
    156         }
    157 
    158         private void OnPopulationRecieved(object sender, MessageRecieveEventArgs e)
    159         {
    160             if (e != null)
    161             {
    162                 lock (activeQueueLocker)
    163                 {
    164                     foreach (byte[] item in e.data)
    165                     {
    166                         writeQueue.Enqueue(item);
    167                     }
    168                 }
    169             }
    170         }
    171 
    172         private void AddError(string source, Exception ex)
    173         {
    174             if (peerListManager != null)
    175             {
    176                 try
    177                 {
    178                     peerListManager.SendLogToServer(string.Concat("Source: ", source, ", Exception: ", ex.Message));
    179                 }
    180                 catch { }
    181             }
    182         }
    183 
    184     }
     152  }
    185153}
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs

    r13923 r13924  
    77using DistributedGA.Core.Interface;
    88
    9 namespace DistributedGA.Core.Implementation
    10 {
    11     public class WcfMessageService : IMessageService
    12     {
    13         public event EventHandler<MessageRecieveEventArgs> OnDataRecieved;
     9namespace DistributedGA.Core.Implementation {
     10  public class WcfMessageService : IMessageService {
     11    public event EventHandler<MessageRecieveEventArgs> OnDataRecieved;
    1412
    15         private static ManualResetEvent _ResetEvent = new ManualResetEvent(false);
     13    private static ManualResetEvent _ResetEvent = new ManualResetEvent(false);
    1614
    17         private IMessageContract messageContract = null;
     15    private IMessageContract messageContract = null;
    1816
    19         public int Init(string ip)
    20         {
    21             int port = 0;
    22             port = FreeTcpPort();
     17    public int Init(string ip) {
     18      int port = 0;
     19      port = FreeTcpPort();
    2320
    24             messageContract = new MessageContractImpl();
    25             messageContract.MessageRecieved += new EventHandler<MessageRecieveEventArgs>(OnMessageRecieved);
     21      messageContract = new MessageContractImpl();
     22      messageContract.MessageRecieved += new EventHandler<MessageRecieveEventArgs>(OnMessageRecieved);
    2623
    27             var serviceUrl = "DistributedGA.svc";
    28             new Thread(() =>
    29             {
    30                 var baseUri = new Uri(string.Concat("net.tcp://", ip, ":", port, "/DistributedGA"));
    31                 var serviceUri = new Uri(baseUri, serviceUrl);
    32                 NetTcpBinding binding = new NetTcpBinding();
     24      var serviceUrl = "DistributedGA.svc";
     25      new Thread(() => {
     26        var baseUri = new Uri(string.Concat("net.tcp://", ip, ":", port, "/DistributedGA"));
     27        var serviceUri = new Uri(baseUri, serviceUrl);
     28        NetTcpBinding binding = new NetTcpBinding();
    3329
    34                 using (var host = new ServiceHost(messageContract, serviceUri))
    35                 {
    36                     host.AddServiceEndpoint(typeof(IMessageContract), binding, serviceUri);
     30        using (var host = new ServiceHost(messageContract, serviceUri)) {
     31          host.AddServiceEndpoint(typeof(IMessageContract), binding, serviceUri);
    3732
    38                     host.Open();
     33          host.Open();
    3934
    40                     _ResetEvent.WaitOne();
    41                 }
    42             }).Start();
    43             return port;
     35          _ResetEvent.WaitOne();
    4436        }
     37      }).Start();
     38      return port;
     39    }
    4540
    46         public void Dispose()
    47         {
    48             _ResetEvent.Set();
    49         }
     41    public void Dispose() {
     42      _ResetEvent.Set();
     43    }
    5044
    51         private int FreeTcpPort()
    52         {
    53             TcpListener l = new TcpListener(IPAddress.Loopback, 0);
    54             l.Start();
    55             int port = ((IPEndPoint)l.LocalEndpoint).Port;
    56             l.Stop();
    57             return port;
    58         }
     45    private int FreeTcpPort() {
     46      TcpListener l = new TcpListener(IPAddress.Loopback, 0);
     47      l.Start();
     48      int port = ((IPEndPoint)l.LocalEndpoint).Port;
     49      l.Stop();
     50      return port;
     51    }
    5952
    60         private void OnMessageRecieved(object sender, MessageRecieveEventArgs e)
    61         {
    62             if (OnDataRecieved != null)
    63             {
    64                 OnDataRecieved(this, e);
    65             }
    66         }
     53    private void OnMessageRecieved(object sender, MessageRecieveEventArgs e) {
     54      if (OnDataRecieved != null) {
     55        OnDataRecieved(this, e);
     56      }
    6757    }
     58  }
    6859}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IContactService.cs

    r13887 r13924  
    77using System.Threading.Tasks;
    88
    9 namespace DistributedGA.Core.Interface
    10 {
    11     [ServiceContract]
    12     public interface IContactService
    13     {
    14         [OperationContract]
    15         void RegisterPeer(PeerInfo source); //Registers own instance at the contact-server
     9namespace DistributedGA.Core.Interface {
     10  [ServiceContract]
     11  public interface IContactService {
     12    [OperationContract]
     13    void RegisterPeer(PeerInfo source); //Registers own instance at the contact-server
    1614
    17         [OperationContract]
    18         List<PeerInfo> GetPeerList(PeerInfo source); //Recieves all peers in the network from contact-server
     15    [OperationContract]
     16    List<PeerInfo> GetPeerList(PeerInfo source); //Recieves all peers in the network from contact-server
    1917
    20         [OperationContract]
    21         void UpdateHeartbeat(PeerInfo source); //Sends heartbeat to contact-server
     18    [OperationContract]
     19    void UpdateHeartbeat(PeerInfo source); //Sends heartbeat to contact-server
    2220
    23         [OperationContract]
    24         void MakeLog(PeerInfo source, string msg); //Used to log all peers at a single location
     21    [OperationContract]
     22    void MakeLog(PeerInfo source, string msg); //Used to log all peers at a single location
    2523
    26     }
     24  }
    2725}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageContract.cs

    r13887 r13924  
    33using DistributedGA.Core.Domain;
    44
    5 namespace DistributedGA.Core.Interface
    6 {
     5namespace DistributedGA.Core.Interface {
    76
    8     [ServiceContract]
    9     public interface IMessageContract
    10     {
     7  [ServiceContract]
     8  public interface IMessageContract {
    119
    12         [OperationContract]
    13         void SendData(PeerInfo sender, byte[][] data);
     10    [OperationContract]
     11    void SendData(PeerInfo sender, byte[][] data);
    1412
    15         event EventHandler<MessageRecieveEventArgs> MessageRecieved;
    16     }
     13    event EventHandler<MessageRecieveEventArgs> MessageRecieved;
     14  }
    1715}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs

    r13887 r13924  
    22using DistributedGA.Core.Domain;
    33
    4 namespace DistributedGA.Core.Interface
    5 {
     4namespace DistributedGA.Core.Interface {
    65
    7     public interface IMessageHandler
    8     {
     6  public interface IMessageHandler {
    97
    10         void Init(string lanIpPrefix, string contactServerUrl); //Registers at contract-server
     8    void Init(string lanIpPrefix, string contactServerUrl); //Registers at contract-server
    119
    12         void PublishDataToNetwork(byte[][] data);
     10    void PublishDataToNetwork(byte[][] data);
    1311
    14         byte[][] GetDataFromNetwork();
     12    byte[][] GetDataFromNetwork();
    1513
    16         PeerInfo GetPeerInfo();
     14    PeerInfo GetPeerInfo();
    1715
    18         List<PeerInfo> GetCurrentNetwork();
     16    List<PeerInfo> GetCurrentNetwork();
    1917
    20         void Dispose();
    21     }
     18    void Dispose();
     19  }
    2220}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs

    r13918 r13924  
    11using DistributedGA.Core.Domain;
    22
    3 namespace DistributedGA.Core.Interface
    4 {
     3namespace DistributedGA.Core.Interface {
    54
    6     public interface IMessageSender
    7     {
     5  public interface IMessageSender {
    86
    9         void Init(PeerInfo source);
     7    void Init(PeerInfo source);
    108
    11         void SendData(PeerInfo destination, byte[][] data);
     9    void SendData(PeerInfo destination, byte[][] data);
    1210
    13         void Dispose();
    14     }
     11    void Dispose();
     12  }
    1513}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageService.cs

    r13887 r13924  
    22using DistributedGA.Core.Domain;
    33
    4 namespace DistributedGA.Core.Interface
    5 {
     4namespace DistributedGA.Core.Interface {
    65
    7     public interface IMessageService
    8     {
     6  public interface IMessageService {
    97
    10         /// <summary>
    11         /// Initializes a WCF service and host it with another thread
    12         /// </summary>
    13         /// <param name="ip">current external ip address</param>
    14         /// <returns>The port, on which the service was successfully hosted</returns>
    15         int Init(string ip);
     8    /// <summary>
     9    /// Initializes a WCF service and host it with another thread
     10    /// </summary>
     11    /// <param name="ip">current external ip address</param>
     12    /// <returns>The port, on which the service was successfully hosted</returns>
     13    int Init(string ip);
    1614
    17         void Dispose();
     15    void Dispose();
    1816
    19         event EventHandler<MessageRecieveEventArgs> OnDataRecieved;
    20     }
     17    event EventHandler<MessageRecieveEventArgs> OnDataRecieved;
     18  }
    2119}
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs

    r13918 r13924  
    22using DistributedGA.Core.Domain;
    33
    4 namespace DistributedGA.Core.Interface
    5 {
     4namespace DistributedGA.Core.Interface {
    65
    7     public interface IPeerListManager
    8     {
     6  public interface IPeerListManager {
    97
    10         void Init(PeerInfo source, string contactServerUrl); //Registers own instance at the contact-server
     8    void Init(PeerInfo source, string contactServerUrl); //Registers own instance at the contact-server
    119
    12         List<PeerInfo> GetPeerList(); //Recieves all peers in the network from contact-server
     10    List<PeerInfo> GetPeerList(); //Recieves all peers in the network from contact-server
    1311
    14         void SendLogToServer(string msg);
     12    void SendLogToServer(string msg);
    1513
    16         void Dispose();
    17     }
     14    void Dispose();
     15  }
    1816}
  • branches/thasling/DistributedGA/DistributedGA.sln

    r13555 r13924  
    22Microsoft Visual Studio Solution File, Format Version 12.00
    33# Visual Studio 2013
    4 VisualStudioVersion = 12.0.31101.0
     4VisualStudioVersion = 12.0.21005.1
    55MinimumVisualStudioVersion = 10.0.40219.1
    66Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistributedGA.Test", "DistributedGA.Test\DistributedGA.Test.csproj", "{E0E91C06-C56A-454F-9F7C-3FA7AE7F920E}"
    77EndProject
    88Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistributedGA.Core", "DistributedGA.Core\DistributedGA.Core.csproj", "{02E73F42-BDC9-4A7A-B74F-5879DEF27320}"
    9 EndProject
    10 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistributedGA.Operator", "DistributedGA.Operator\DistributedGA.Operator.csproj", "{2443717F-222B-41AB-AC69-0EF69E83765F}"
    119EndProject
    1210Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistributedGA.ContactServer", "DistributedGA.ContactServer\DistributedGA.ContactServer.csproj", "{554DAD06-0BF9-4908-BD62-D5FDC46A8B74}"
     
    3230    {02E73F42-BDC9-4A7A-B74F-5879DEF27320}.Release|Any CPU.ActiveCfg = Release|Any CPU
    3331    {02E73F42-BDC9-4A7A-B74F-5879DEF27320}.Release|Any CPU.Build.0 = Release|Any CPU
    34     {2443717F-222B-41AB-AC69-0EF69E83765F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    35     {2443717F-222B-41AB-AC69-0EF69E83765F}.Debug|Any CPU.Build.0 = Debug|Any CPU
    36     {2443717F-222B-41AB-AC69-0EF69E83765F}.Release|Any CPU.ActiveCfg = Release|Any CPU
    37     {2443717F-222B-41AB-AC69-0EF69E83765F}.Release|Any CPU.Build.0 = Release|Any CPU
    3832    {554DAD06-0BF9-4908-BD62-D5FDC46A8B74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    3933    {554DAD06-0BF9-4908-BD62-D5FDC46A8B74}.Debug|Any CPU.Build.0 = Debug|Any CPU
Note: See TracChangeset for help on using the changeset viewer.