Changeset 14060
- Timestamp:
- 07/13/16 15:37:29 (8 years ago)
- Location:
- branches/thasling/DistributedGA
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
r14009 r14060 18 18 private Object timerLock = new Object(); 19 19 20 private ChannelFactory<IContactService> myChannelFactory;21 22 private IContactService client;23 24 20 private List<PeerInfo> cachedPeerList; 25 21 … … 34 30 cachedPeerList = new List<PeerInfo>(); 35 31 rand = new Random(); 36 //Init ChannelFactory and Client37 var binding = new NetTcpBinding();38 var endpoint = new EndpointAddress(serverString);39 myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint);40 client = myChannelFactory.CreateChannel();41 //Register Peer42 client.RegisterPeer(myself);43 32 //Start heartbeat timer 44 33 timer = new Timer(1000 * 20); //each 20 seconds … … 52 41 53 42 public void SendLogToServer(string msg) { 54 client.MakeLog(myself, msg); 43 var binding = new NetTcpBinding(); 44 var endpoint = new EndpointAddress(serverString); 45 using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) { 46 using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) { 47 ((IContactService)client).MakeLog(myself, msg); 48 } 49 } 55 50 } 56 51 … … 58 53 timer.Stop(); 59 54 timer.Dispose(); 60 ((IClientChannel)client).Close();61 myChannelFactory.Close();62 myChannelFactory = null;63 55 } 64 56 … … 86 78 lock (timerLock) { 87 79 try { 88 var allPeers = client.GetPeerList(myself); 80 List<PeerInfo> allPeers = new List<PeerInfo>(); 81 var binding = new NetTcpBinding(); 82 var endpoint = new EndpointAddress(serverString); 83 using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) { 84 using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) { 85 allPeers = ((IContactService)client).GetPeerList(myself); 86 } 87 } 89 88 cachedPeerList = ChoosePeersForMessaging(ref allPeers); 90 89 } -
branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
r14033 r14060 74 74 get { return (IValueParameter<ILog>)Parameters["Log"]; } 75 75 } 76 public I LookupParameter<StringValue> JobGuidParameter {77 get { return (I LookupParameter<StringValue>)Parameters["JobGUID"]; }76 public IValueParameter<StringValue> JobGuidParameter { 77 get { return (IValueParameter<StringValue>)Parameters["JobGUID"]; } 78 78 } 79 79 … … 118 118 Parameters.Add(new ValueParameter<StringValue>("ContactServerURL", "", new StringValue("net.tcp://10.42.1.150:9090/DistributedGA.ContactServer/ContactService"))); 119 119 Parameters.Add(new ValueParameter<StringValue>("JobGUID", "", new StringValue(Guid.NewGuid().ToString()))); 120 //public ILookupParameter<StringValue> JobGuidParameter { 121 // get { return (ILookupParameter<StringValue>)Parameters["JobGUID"]; } 122 //} 123 120 124 Parameters.Add(new ValueParameter<ILog>("Log", "The log", new Log(1000))); 121 125
Note: See TracChangeset
for help on using the changeset viewer.