Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/tools/ExternalEvaluation/Java/ExternalEvaluation.Service/src/com/heuristiclab/problems/externalevaluation/ServerSocketListenerFactory.java @ 15014

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

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

File size: 601 bytes
Line 
1package com.heuristiclab.problems.externalevaluation;
2
3public class ServerSocketListenerFactory implements IListenerFactory {
4
5  private String ipAddress;
6  private int port;
7 
8  public ServerSocketListenerFactory(int port) {
9    this.ipAddress = null;
10    this.port = port;
11  }
12 
13  public ServerSocketListenerFactory(int port, String ipAddress) {
14    this.ipAddress = ipAddress;
15    this.port = port;
16  }
17 
18  @Override
19  public IListener createListener() {
20    if (ipAddress == null)
21      return new ServerSocketListener(port);
22    else
23      return new ServerSocketListener(port, ipAddress);
24  }
25
26}
Note: See TracBrowser for help on using the repository browser.