Changeset 6760 for branches/PersistenceSpeedUp/HeuristicLab.Problems.ExternalEvaluation/3.3/Drivers/EvaluationTCPChannel.cs
- Timestamp:
- 09/14/11 13:59:25 (13 years ago)
- Location:
- branches/PersistenceSpeedUp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceSpeedUp
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/PersistenceSpeedUp/HeuristicLab.Problems.ExternalEvaluation/3.3/Drivers/EvaluationTCPChannel.cs
r5445 r6760 32 32 [StorableClass] 33 33 public class EvaluationTCPChannel : EvaluationChannel { 34 34 35 public const int MAX_VARINT32_SIZE = 5; 35 36 37 #region Fields & Properties 36 38 [Storable] 37 39 private string ipAddress; … … 39 41 get { return ipAddress; } 40 42 set { 41 bool changed = !ipAddress.Equals(value);43 if (value == ipAddress) return; 42 44 ipAddress = value; 43 if (changed)44 45 UpdateName(); 46 OnIpAddressChanged(); 45 47 } 46 48 } … … 50 52 get { return port; } 51 53 set { 52 bool changed = port != value;54 if (value == port) return; 53 55 port = value; 54 if (changed)55 56 UpdateName(); 57 OnPortChanged(); 56 58 } 57 59 } 58 60 private Socket socket; 59 61 #endregion 62 63 #region Construction & Cloning 60 64 [StorableConstructor] 61 65 protected EvaluationTCPChannel(bool deserializing) : base(deserializing) { } … … 64 68 ipAddress = original.ipAddress; 65 69 port = original.port; 66 } 70 UpdateName(); 71 } 72 67 73 public override IDeepCloneable Clone(Cloner cloner) { 68 74 return new EvaluationTCPChannel(this, cloner); … … 74 80 this.ipAddress = ip; 75 81 this.port = port; 76 } 82 UpdateName(); 83 } 84 [StorableHook(HookType.AfterDeserialization)] 85 private void AfterDeserialization() { 86 UpdateName(); 87 } 88 #endregion 89 90 77 91 78 92 #region IExternalEvaluationChannel Members … … 183 197 #endregion 184 198 199 #region Auxiliary Methods 200 private void UpdateName() { 201 name = string.Format("TCPChannel {0}:{1}", ipAddress, port); 202 OnNameChanged(); 203 } 204 #endregion 205 185 206 #region Events 186 207 public event EventHandler IpAddressChanged;
Note: See TracChangeset
for help on using the changeset viewer.