Free cookie consent management tool by TermsFeed Policy Generator

source: misc/tools/ExternalEvaluation/CSharp/ExternalEvaluation.Service.Host/Program.cs @ 17690

Last change on this file since 17690 was 15014, checked in by pfleck, 8 years ago

Added code and tools for the ExternalEvaluationProblem. (e.g. Java-side evaluation)

File size: 779 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Problems.ExternalEvaluation.Service;
6using Google.ProtocolBuffers;
7
8namespace ExternalEvaluation.Service.Host {
9  class Program {
10    static void Main(string[] args) {
11      ServerSocketListenerFactory socket = new ServerSocketListenerFactory(9991);
12      PollService service = new PollService(socket);
13      service.Start();
14      while (true) {
15        Console.WriteLine("Waiting for message...");
16        var solution = service.GetSolution();
17        if (solution == null) break;
18        Console.WriteLine("Received: " + solution.SolutionId);
19        service.SendQuality(solution, 1);
20        Console.WriteLine("Replied!");
21      }
22    }
23  }
24}
Note: See TracBrowser for help on using the repository browser.