Program.cs 731 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
using System;
using WebSocketSharp;
using WebSocketSharp.Server;
using Tobii.Research;

namespace GazeWebSocketServer
{
    public class Program
    {
        public static void Main(string[] args)
        {
12 13 14 15
            ConfigurationData.InitializeUnexistingWithDefaults();
            ConfigurationData config = ConfigurationData.ParseToObject();

            var wssv = new WebSocketServer(config.WebSocketPort);
16
            wssv.KeepClean = true;
17 18
            GazeCoordinateBehavior behavior = new GazeCoordinateBehavior(config);
            wssv.AddWebSocketService(config.WebSocketEndpoint, () => behavior);
19
            
20 21 22 23 24 25
            wssv.Start();
            Console.ReadKey(true);
            wssv.Stop();
        }
    }
}