Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13971 for branches/thasling


Ignore:
Timestamp:
07/01/16 19:23:56 (8 years ago)
Author:
thasling
Message:

#2615:
increased message size to 20MB
made changes in some interfaces

Location:
branches/thasling/DistributedGA
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.Core/Domain/MessageRecieveEventArgs.cs

    r13924 r13971  
    44  public class MessageRecieveEventArgs : EventArgs {
    55    public int val;
    6     public byte[][] data { get; set; }
     6    public byte[] data { get; set; }
    77    public PeerInfo Sender { get; set; }
    88  }
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/MessageContractImpl.cs

    r13924 r13971  
    77  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    88  public class MessageContractImpl : IMessageContract {
    9     public void SendData(PeerInfo sender, byte[][] data) {
     9    public void SendData(PeerInfo sender, byte[] data) {
    1010      MessageRecieveEventArgs args = new MessageRecieveEventArgs() { Sender = sender, data = data };
    1111
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs

    r13970 r13971  
    146146      if (e != null && e.Sender.ProblemInstance.Equals(ownInstance.ProblemInstance)) {
    147147        lock (activeQueueLocker) {
    148           foreach (byte[] item in e.data) {
    149             writeQueue.Enqueue(item);
    150           }
     148            writeQueue.Enqueue(e.data);
    151149        }
    152150
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs

    r13970 r13971  
    102102    private void SendDataFromQueue(PeerInfo destination, byte[][] data) {
    103103      try {
    104         int arrayLength = 3;
    105         if (data.GetUpperBound(0) > arrayLength) {
    106           //HACK: SEND MAX 10 items
    107           byte[][] fake = new byte[arrayLength][];
    108           for (int i = 0; i < arrayLength; i++) {
    109             fake[i] = data[i];
    110           }
    111           data = fake;
    112         }
     104        //int arrayLength = 3;
     105        //if (data.GetUpperBound(0) > arrayLength) {
     106        //  //HACK: SEND MAX 10 items
     107        //  byte[][] fake = new byte[arrayLength][];
     108        //  for (int i = 0; i < arrayLength; i++) {
     109        //    fake[i] = data[i];
     110        //  }
     111        //  data = fake;
     112        //}
    113113
    114114
     
    119119
    120120        var binding = new NetTcpBinding();
     121        binding.MaxReceivedMessageSize = 20000000;
     122        binding.MaxBufferSize = 20000000;
     123        binding.MaxBufferPoolSize = 20000000;
     124        binding.ReaderQuotas.MaxArrayLength = 20000000;
     125        binding.ReaderQuotas.MaxDepth = 32;
     126        binding.ReaderQuotas.MaxStringContentLength = 20000000;
     127
    121128        var endpoint = new EndpointAddress(serviceUri);
    122129        using (var myChannelFactory = new ChannelFactory<IMessageContract>(binding, endpoint)) {
    123130          using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) {
    124             ((IMessageContract)client).SendData(myself, data); //maybe timout exception...
     131            for (int i = 0; i < data.GetUpperBound(0) + 1; i++) {
     132              ((IMessageContract)client).SendData(myself, data[i]); //maybe timout exception...
     133            }
    125134          }
    126135        }
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs

    r13956 r13971  
    2727        var serviceUri = new Uri(baseUri, serviceUrl);
    2828        NetTcpBinding binding = new NetTcpBinding();
     29        binding.MaxReceivedMessageSize = 20000000;
     30        binding.MaxBufferSize = 20000000;
     31        binding.MaxBufferPoolSize = 20000000;
     32        binding.ReaderQuotas.MaxArrayLength = 20000000;
     33        binding.ReaderQuotas.MaxDepth = 32;
     34        binding.ReaderQuotas.MaxStringContentLength = 20000000;
    2935
    3036        using (var host = new ServiceHost(messageContract, serviceUri)) {
  • branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageContract.cs

    r13924 r13971  
    99
    1010    [OperationContract]
    11     void SendData(PeerInfo sender, byte[][] data);
     11    void SendData(PeerInfo sender, byte[] data);
    1212
    1313    event EventHandler<MessageRecieveEventArgs> MessageRecieved;
  • branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs

    r13970 r13971  
    205205          }
    206206        }
    207         //each subscope is one emigrand
    208         //IScope emigrants = scope.SubScopes[1];
    209         //emigrantsList.Add(emigrants);
    210207
    211208        {
     
    221218                msgScope.Variables.Add((IVariable)variable.Clone(cloner));
    222219              }
    223               msgScope.ClearParentScopes();
    224220              HeuristicLab.Persistence.Default.Xml.XmlGenerator.Serialize(msgScope, stream);
    225221              message[ei] = stream.GetBuffer();
Note: See TracChangeset for help on using the changeset viewer.