Program.cs 684 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 16 17
            ConfigurationData.InitializeUnexistingWithDefaults();
            ConfigurationData config = ConfigurationData.ParseToObject();

            var wssv = new WebSocketServer(config.WebSocketPort);
            GazeCoordinateBehavior behavior = new GazeCoordinateBehavior(config);
            wssv.AddWebSocketService(config.WebSocketEndpoint, () => behavior);
18 19 20 21 22 23 24

            wssv.Start();
            Console.ReadKey(true);
            wssv.Stop();
        }
    }
}