Changeset 4119 for branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Communication/3.3/WcfService.cs
- Timestamp:
- 07/28/10 17:48:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Communication/3.3/WcfService.cs
r4107 r4119 262 262 Logger.Debug("STARTED: Sending back the finished job results"); 263 263 Logger.Debug("Building stream"); 264 Stream stream = 265 GetStreamedJobResult(clientId, jobId, result, percentage, exception); 264 Stream stream = GetStreamedJobResult(clientId, jobId, result, percentage, exception); 266 265 Logger.Debug("Builded stream"); 267 266 Logger.Debug("Making the call"); … … 269 268 } 270 269 } 270 271 271 private void proxy_StoreFinishedJobResultStreamedCompleted(object sender, StoreFinishedJobResultStreamedCompletedEventArgs e) { 272 272 Logger.Debug("Finished storing the job"); 273 Stream stream = 274 (Stream)e.UserState; 273 Stream stream = (Stream)e.UserState; 275 274 if (stream != null) { 276 275 Logger.Debug("Stream not null, disposing it"); … … 278 277 } 279 278 if (e.Error == null) { 280 StoreFinishedJobResultCompletedEventArgs args = 281 new StoreFinishedJobResultCompletedEventArgs( 282 new object[] { e.Result }, e.Error, e.Cancelled, e.UserState); 279 StoreFinishedJobResultCompletedEventArgs args = new StoreFinishedJobResultCompletedEventArgs(new object[] { e.Result }, e.Error, e.Cancelled, e.UserState); 283 280 Logger.Debug("calling the Finished Job Event"); 284 281 StoreFinishedJobResultCompleted(sender, args); 285 282 Logger.Debug("ENDED: Sending back the finished job results"); 286 } else 283 } else { 287 284 HandleNetworkError(e.Error); 285 } 288 286 } 289 287 … … 300 298 } 301 299 } 300 302 301 void proxy_ProcessSnapshotStreamedCompleted(object sender, ProcessSnapshotStreamedCompletedEventArgs e) { 303 302 Stream stream = … … 350 349 /// </summary> 351 350 private Stream GetStreamedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) { 352 JobResult jobResult = 353 new JobResult(); 351 JobResult jobResult = new JobResult(); 354 352 jobResult.ClientId = clientId; 355 353 jobResult.JobId = jobId; … … 357 355 jobResult.Exception = exception; 358 356 359 MultiStream stream = 360 new MultiStream(); 357 MultiStream stream = new MultiStream(); 361 358 362 359 //first send result 363 stream.AddStream( 364 new StreamedObject<JobResult>(jobResult)); 360 stream.AddStream(new StreamedObject<JobResult>(jobResult)); 365 361 366 362 //second stream the job binary data 367 MemoryStream memStream = 368 new MemoryStream(result, false); 363 MemoryStream memStream = new MemoryStream(result, false); 369 364 stream.AddStream(memStream); 370 365 … … 373 368 374 369 public ResponseResultReceived StoreFinishedJobResultsSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) { 375 return proxy.StoreFinishedJobResultStreamed( 376 GetStreamedJobResult(clientId, jobId, result, percentage, exception)); 370 return proxy.StoreFinishedJobResultStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception)); 377 371 } 378 372 … … 387 381 return null; 388 382 } 389 390 383 } 391 384 392 385 public ResponseResultReceived ProcessSnapshotSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) { 393 386 try { 394 return proxy.ProcessSnapshotStreamed( 395 GetStreamedJobResult(clientId, jobId, result, percentage, exception)); 387 return proxy.ProcessSnapshotStreamed(GetStreamedJobResult(clientId, jobId, result, percentage, exception)); 396 388 } catch (Exception e) { 397 389 HandleNetworkError(e); … … 453 445 } 454 446 } 455 456 447 } 457 448 }
Note: See TracChangeset
for help on using the changeset viewer.