-
Notifications
You must be signed in to change notification settings - Fork 9
/
Service.cs
79 lines (70 loc) · 2.32 KB
/
Service.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright (c) 2012, Fuji Xerox Co., Ltd.
// All rights reserved.
// Author: Surendar Chandra, FX Palo Alto Laboratory, Inc.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Collections;
namespace FXPAL.DisplayCast.ControllerService {
public partial class Service : ServiceBase {
private ArrayList sessionList = new ArrayList();
private ArrayList playerList = new ArrayList();
private ArrayList streamerList = new ArrayList();
private ArrayList archiverList = new ArrayList();
private ArrayList sinkServicesList = new ArrayList();
private ArrayList sourceServicesList = new ArrayList();
private monitorPlayers players = null;
private APIresponder api = null;
/// <summary>
///
/// </summary>
/// <param name="args"></param>
protected override void OnStart(string[] args) {
Start();
}
/// <summary>
///
/// </summary>
public void Start() {
players = new monitorPlayers(sessionList, playerList, streamerList, archiverList, sinkServicesList, sourceServicesList);
api = new APIresponder(sessionList, playerList, streamerList, archiverList, sinkServicesList, sourceServicesList);
#if CONTROLLER_DEBUG_SERVICE
while (true) {
Thread.Sleep(100);
}
#endif
}
/// <summary>
///
/// </summary>
protected override void OnStop() {
if (players != null) {
try {
players.playerBrowser.Stop();
players.archiveBrowser.Stop();
players.streamerBrowser.Stop();
} catch (Exception) {
}
}
if (api != null) {
try {
api.listener.Stop();
} catch (Exception) {
}
}
this.ExitCode = 0;
}
/// <summary>
///
/// </summary>
public Service() {
InitializeComponent();
}
}
}