Commit cbbd24f5 by Stefan Schreistetter

Fixed problem where behavior was not correctly instantiated. Added null checking for sessions.

parent 27325516
......@@ -30,7 +30,7 @@ namespace GazeWebSocketServer
internal void Publish(GazeData gazeData)
{
Sessions.Broadcast(gazeData.ToString());
Sessions?.Broadcast(gazeData.ToString());
}
}
}
......@@ -9,8 +9,9 @@ namespace GazeWebSocketServer
{
public static void Main(string[] args)
{
var wssv = new WebSocketServer("ws://localhost:8001");
wssv.AddWebSocketService("/gaze", () => new GazeCoordinateBehavior());
var wssv = new WebSocketServer(8001);
GazeCoordinateBehavior behavior = new GazeCoordinateBehavior();
wssv.AddWebSocketService("/gaze", () => behavior);
wssv.Start();
Console.ReadKey(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment